Do not call the VOP_LOOKUP() for the doomed directory vnode. The

vnode could be reclaimed while lock upgrade was performed.

Sponsored by:	The FreeBSD Foundation
Reported and tested by:	pho
Diagnosed and reviewed by:	rmacklem
MFC after:	1 week
This commit is contained in:
Konstantin Belousov 2013-04-01 09:59:38 +00:00
parent 6460981c3a
commit c686ee4685
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=248969

View File

@ -698,6 +698,10 @@ lookup(struct nameidata *ndp)
VOP_ISLOCKED(dp) == LK_SHARED &&
(cnp->cn_flags & ISLASTCN) && (cnp->cn_flags & LOCKPARENT))
vn_lock(dp, LK_UPGRADE|LK_RETRY);
if ((dp->v_iflag & VI_DOOMED) != 0) {
error = ENOENT;
goto bad;
}
/*
* If we're looking up the last component and we need an exclusive
* lock, adjust our lkflags.