vfs_lookup(): re-check v_mountedhere on lock upgrade

The VV_CROSSLOCK handling logic may need to upgrade the covered
vnode lock depending upon the requirements of the filesystem into
which vfs_lookup() is walking.  This may involve transiently
dropping the lock, which can allow the target mount to be unmounted.

Tested by:	pho
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D39272
This commit is contained in:
Jason A. Harmening 2023-03-28 13:06:29 -05:00
parent 93fe61afde
commit 0c01203e47

View File

@ -1280,6 +1280,9 @@ vfs_lookup(struct nameidata *ndp)
error = ENOENT;
goto bad2;
}
if (dp->v_mountedhere != mp) {
continue;
}
} else
crosslkflags &= ~LK_NODDLKTREAT;
}