Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 8 Oct 2022 23:25:40 GMT
From:      Rick Macklem <rmacklem@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 690222c3f120 - stable/12 - nfs_clvnops.c: Fix access to v_mount when vnode unlocked
Message-ID:  <202210082325.298NPe5S033884@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/12 has been updated by rmacklem:

URL: https://cgit.FreeBSD.org/src/commit/?id=690222c3f1200cf4e98c4ba3053f1d10eafc22a2

commit 690222c3f1200cf4e98c4ba3053f1d10eafc22a2
Author:     Rick Macklem <rmacklem@FreeBSD.org>
AuthorDate: 2022-10-01 23:30:07 +0000
Commit:     Rick Macklem <rmacklem@FreeBSD.org>
CommitDate: 2022-10-08 23:24:50 +0000

    nfs_clvnops.c: Fix access to v_mount when vnode unlocked
    
    Commit ab17854f974b fixed access to v_mount when the
    vnode is unlocked for nfs_copy_file_range().
    
    This patch does the same for nfs_advlockasync().
    
    (cherry picked from commit a82308abab86740e9bc37499bd2a13568764d7a0)
---
 sys/fs/nfsclient/nfs_clvnops.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/sys/fs/nfsclient/nfs_clvnops.c b/sys/fs/nfsclient/nfs_clvnops.c
index 64386afccb4c..24c53de7309c 100644
--- a/sys/fs/nfsclient/nfs_clvnops.c
+++ b/sys/fs/nfsclient/nfs_clvnops.c
@@ -3320,11 +3320,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, 0);
+		return (EOPNOTSUPP);
+	}
 	if ((VFSTONFS(vp->v_mount)->nm_flag & NFSMNT_NOLOCKD) != 0) {
 		size = VTONFS(vp)->n_size;
 		NFSVOPUNLOCK(vp, 0);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202210082325.298NPe5S033884>