From 294fd952b08d1539c3c5e977e156c2cb45f0878a Mon Sep 17 00:00:00 2001 From: kib Date: Tue, 2 Dec 2008 11:12:50 +0000 Subject: 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 --- sys/ufs/ufs/ufs_lookup.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'sys') diff --git a/sys/ufs/ufs/ufs_lookup.c b/sys/ufs/ufs/ufs_lookup.c index d464e00..65ab0da 100644 --- a/sys/ufs/ufs/ufs_lookup.c +++ b/sys/ufs/ufs/ufs_lookup.c @@ -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; -- cgit v1.1