Author: kib
Date: Sat May 10 07:56:01 2014
New Revision: 265808
URL: http://svnweb.freebsd.org/changeset/base/265808

Log:
  MFC r265275:
  Overwrite the de_Name for the directories on rename to correct the dot
  name.

Modified:
  stable/9/sys/fs/msdosfs/msdosfs_vnops.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/fs/   (props changed)

Modified: stable/9/sys/fs/msdosfs/msdosfs_vnops.c
==============================================================================
--- stable/9/sys/fs/msdosfs/msdosfs_vnops.c     Sat May 10 07:53:36 2014        
(r265807)
+++ stable/9/sys/fs/msdosfs/msdosfs_vnops.c     Sat May 10 07:56:01 2014        
(r265808)
@@ -1219,6 +1219,17 @@ abortit:
                        VOP_UNLOCK(fvp, 0);
                        goto bad;
                }
+               /*
+                * If ip is for a directory, then its name should always
+                * be "." since it is for the directory entry in the
+                * directory itself (msdosfs_lookup() always translates
+                * to the "." entry so as to get a unique denode, except
+                * for the root directory there are different
+                * complications).  However, we just corrupted its name
+                * to pass the correct name to createde().  Undo this.
+                */
+               if ((ip->de_Attributes & ATTR_DIRECTORY) != 0)
+                       bcopy(oldname, ip->de_Name, 11);
                ip->de_refcnt++;
                zp->de_fndoffset = from_diroffset;
                error = removede(zp, ip);
_______________________________________________
svn-src-stable-9@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-stable-9
To unsubscribe, send any mail to "svn-src-stable-9-unsubscr...@freebsd.org"

Reply via email to