Index: sys/fs/msdosfs/msdosfs_vnops.c =================================================================== --- sys/fs/msdosfs/msdosfs_vnops.c +++ sys/fs/msdosfs/msdosfs_vnops.c @@ -1007,13 +1007,11 @@ if ((fcnp->cn_namelen == 1 && fcnp->cn_nameptr[0] == '.') || dp == ip || (fcnp->cn_flags & ISDOTDOT) || - (tcnp->cn_flags & ISDOTDOT) || - (ip->de_flag & DE_RENAME)) { + (tcnp->cn_flags & ISDOTDOT)) { VOP_UNLOCK(fvp); error = EINVAL; goto abortit; } - ip->de_flag |= DE_RENAME; doingdirectory++; } @@ -1113,11 +1111,6 @@ if (relookup(fdvp, &fvp, fcnp) == 0) vrele(fdvp); if (fvp == NULL) { - /* - * From name has disappeared. - */ - if (doingdirectory) - panic("rename: lost dir entry"); if (newparent) VOP_UNLOCK(tdvp); vrele(tdvp); @@ -1140,16 +1133,13 @@ * Ensure that the directory entry still exists and has not * changed till now. If the source is a file the entry may * have been unlinked or renamed. In either case there is - * no further work to be done. If the source is a directory - * then it cannot have been rmdir'ed or renamed; this is - * prohibited by the DE_RENAME flag. + * no further work to be done. */ if (xp != ip) { - if (doingdirectory) - panic("rename: lost dir entry"); if (newparent) VOP_UNLOCK(fdvp); vrele(ap->a_fvp); + ip = NULL; xp = NULL; } else { vrele(fvp); @@ -1220,7 +1210,7 @@ * If we moved a directory to a new parent directory, then we must * fixup the ".." entry in the moved directory. */ - if (doingdirectory && newparent) { + if (ip != NULL && doingdirectory && newparent) { cn = ip->de_StartCluster; if (cn == MSDOSFSROOT) { /* this should never happen */ @@ -1264,7 +1254,6 @@ vput(tvp); vput(tdvp); out: - ip->de_flag &= ~DE_RENAME; vrele(fdvp); vrele(fvp); return (error); @@ -1428,7 +1417,7 @@ * non-empty.) */ error = 0; - if (!dosdirempty(ip) || ip->de_flag & DE_RENAME) { + if (!dosdirempty(ip)) { error = ENOTEMPTY; goto out; }