nfs_clvnops.c: Fix access to v_mount when vnode unlocked

Commit ab17854f97 fixed access to v_mount when the
vnode is unlocked for nfs_copy_file_range().

This patch does the same for nfs_advlockasync().

MFC after:	1 week
This commit is contained in:
Rick Macklem 2022-10-01 16:30:07 -07:00
parent 497cdf9673
commit a82308abab

View file

@ -3417,11 +3417,13 @@ nfs_advlockasync(struct vop_advlockasync_args *ap)
u_quad_t size;
int error;
if (NFS_ISV4(vp))
return (EOPNOTSUPP);
error = NFSVOPLOCK(vp, LK_SHARED);
if (error)
return (error);
if (NFS_ISV4(vp)) {
NFSVOPUNLOCK(vp);
return (EOPNOTSUPP);
}
if ((VFSTONFS(vp->v_mount)->nm_flag & NFSMNT_NOLOCKD) != 0) {
size = VTONFS(vp)->n_size;
NFSVOPUNLOCK(vp);