Do not lock vnode interlock around reading of v_iflag to check VI_DOOMED.

Read of the pointer is atomic, and flag cannot be set while vnode lock
is held.

Requested by:	jhb
MFC after:	1 month
This commit is contained in:
Konstantin Belousov 2008-12-02 11:12:50 +00:00
parent dfd9bc23c9
commit ffdaeffe21

View File

@ -157,7 +157,6 @@ ufs_lookup(ap)
int nameiop = cnp->cn_nameiop;
ino_t ino;
int ltype;
int pdoomed;
struct mount *mp;
bp = NULL;
@ -588,20 +587,14 @@ found:
VOP_UNLOCK(pdp, 0);
pause("ufs_dd", 1);
vn_lock(pdp, ltype | LK_RETRY);
VI_LOCK(pdp);
pdoomed = pdp->v_iflag & VI_DOOMED;
VI_UNLOCK(pdp);
if (pdoomed)
if (pdp->v_iflag & VI_DOOMED)
return (ENOENT);
}
VOP_UNLOCK(pdp, 0); /* race to get the inode */
error = VFS_VGET(mp, ino, cnp->cn_lkflags, &tdp);
vfs_unbusy(mp);
vn_lock(pdp, ltype | LK_RETRY);
VI_LOCK(pdp);
pdoomed = pdp->v_iflag & VI_DOOMED;
VI_UNLOCK(pdp);
if (pdoomed) {
if (pdp->v_iflag & VI_DOOMED) {
if (error == 0)
vput(tdp);
error = ENOENT;