Fix a possible race where the directory dirent is moved to the location

that was used by ".." entry.
This change seems fixed panic during attempt to access msdosfs data
over nfs.

Reviewed by:	kib
MFC after:	1 week
This commit is contained in:
Kevin Lo 2010-10-18 03:34:33 +00:00
parent 34c9624e2d
commit 4bc8fad7bd
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=214001

View File

@ -594,10 +594,15 @@ msdosfs_deget_dotdot(struct vnode *vp, u_long cluster, int blkoff,
vfs_unbusy(mp);
if (error == 0)
*rvp = DETOV(rdp);
vn_lock(vp, ltype | LK_RETRY);
if (*rvp != vp)
vn_lock(vp, ltype | LK_RETRY);
if (vp->v_iflag & VI_DOOMED) {
if (error == 0)
vput(*rvp);
if (error == 0) {
if (*rvp == vp)
vunref(*rvp);
else
vput(*rvp);
}
error = ENOENT;
}
return (error);