diff options
author | kib <kib@FreeBSD.org> | 2014-05-10 07:53:36 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2014-05-10 07:53:36 +0000 |
commit | 2ae994402aaab5de27a1208aef5cf00f4db4aa64 (patch) | |
tree | a92711f4f230a680680c6ee2fa1b2171bdd5b827 /sys/fs | |
parent | 7e66d0998da5c9be66c60df770461c3f688bd791 (diff) | |
download | FreeBSD-src-2ae994402aaab5de27a1208aef5cf00f4db4aa64.zip FreeBSD-src-2ae994402aaab5de27a1208aef5cf00f4db4aa64.tar.gz |
MFC r265275:
Overwrite the de_Name for the directories on rename to correct the dot
name.
Diffstat (limited to 'sys/fs')
-rw-r--r-- | sys/fs/msdosfs/msdosfs_vnops.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sys/fs/msdosfs/msdosfs_vnops.c b/sys/fs/msdosfs/msdosfs_vnops.c index 04cb372..856ec7c 100644 --- a/sys/fs/msdosfs/msdosfs_vnops.c +++ b/sys/fs/msdosfs/msdosfs_vnops.c @@ -1240,6 +1240,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); |