vn_vget_ino_gen(): relock the lower vnode on error.

The function' interface assumes that the lower vnode is passed and
returned locked always.

Reported and tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
This commit is contained in:
Konstantin Belousov 2019-08-27 08:28:38 +00:00
parent c537e887ac
commit 95acb40caa

View File

@ -2097,7 +2097,7 @@ vn_vget_ino_gen(struct vnode *vp, vn_get_ino_t alloc, void *alloc_arg,
VOP_UNLOCK(vp, 0);
error = alloc(mp, alloc_arg, lkflags, rvp);
vfs_unbusy(mp);
if (*rvp != vp)
if (error != 0 || *rvp != vp)
vn_lock(vp, ltype | LK_RETRY);
if (vp->v_iflag & VI_DOOMED) {
if (error == 0) {