Index: sys/fs/msdosfs/msdosfs_vnops.c =================================================================== --- sys/fs/msdosfs/msdosfs_vnops.c +++ sys/fs/msdosfs/msdosfs_vnops.c @@ -1257,7 +1257,12 @@ vput(tvp); vput(tdvp); out: - ip->de_flag &= ~DE_RENAME; + if (doingdirectory) { + vn_lock(fvp, LK_EXCLUSIVE | LK_RETRY); + if (VTODE(fvp) == ip) + ip->de_flag &= ~DE_RENAME; + VOP_UNLOCK(fvp); + } vrele(fdvp); vrele(fvp); return (error);