Do not return success and doomed vnode from lookup. LK_UPGRADE allows

the vnode to be reclaimed.

Tested by:	pho
MFC after:	1 month
This commit is contained in:
kib 2008-12-18 11:58:12 +00:00
parent b08c9bbff4
commit fe785ac856

View File

@ -814,6 +814,10 @@ lookup(struct nameidata *ndp)
if ((cnp->cn_flags & (ISLASTCN | LOCKSHARED | LOCKLEAF)) ==
(ISLASTCN | LOCKLEAF) && VOP_ISLOCKED(dp) != LK_EXCLUSIVE) {
vn_lock(dp, LK_UPGRADE | LK_RETRY);
if (dp->v_iflag & VI_DOOMED) {
error = ENOENT;
goto bad2;
}
}
if (vfslocked && dvfslocked)
VFS_UNLOCK_GIANT(dvfslocked); /* Only need one */