Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 Sep 2019 21:43:52 +0000 (UTC)
From:      Rick Macklem <rmacklem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r351832 - projects/nfsv42/sys/fs/nfsclient
Message-ID:  <201909042143.x84Lhq8E007550@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rmacklem
Date: Wed Sep  4 21:43:52 2019
New Revision: 351832
URL: https://svnweb.freebsd.org/changeset/base/351832

Log:
  Move vn_lock() down, so that it doesn't return ENOTTY with the vnode locked.

Modified:
  projects/nfsv42/sys/fs/nfsclient/nfs_clvnops.c

Modified: projects/nfsv42/sys/fs/nfsclient/nfs_clvnops.c
==============================================================================
--- projects/nfsv42/sys/fs/nfsclient/nfs_clvnops.c	Wed Sep  4 20:55:48 2019	(r351831)
+++ projects/nfsv42/sys/fs/nfsclient/nfs_clvnops.c	Wed Sep  4 21:43:52 2019	(r351832)
@@ -3713,10 +3713,6 @@ nfs_ioctl(struct vop_ioctl_args *ap)
 		return (error);
 	}
 
-	error = vn_lock(vp, LK_SHARED);
-	if (error != 0)
-		return (EBADF);
-
 	/* Do the actual NFSv4.2 RPC. */
 	switch (ap->a_command) {
 	case FIOSEEKDATA:
@@ -3728,6 +3724,10 @@ nfs_ioctl(struct vop_ioctl_args *ap)
 	default:
 		return (ENOTTY);
 	}
+
+	error = vn_lock(vp, LK_SHARED);
+	if (error != 0)
+		return (EBADF);
 	attrflag = 0;
 	if (*((off_t *)ap->a_data) >= VTONFS(vp)->n_size)
 		error = ENXIO;



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