Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 26 Jun 2016 13:16:02 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r302208 - stable/10/sys/fs/nfsclient
Message-ID:  <201606261316.u5QDG25x079716@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Sun Jun 26 13:16:02 2016
New Revision: 302208
URL: https://svnweb.freebsd.org/changeset/base/302208

Log:
  MFC r302019:
  Do not access NFS data for reclaimed vnode.

Modified:
  stable/10/sys/fs/nfsclient/nfs_clvnops.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/fs/nfsclient/nfs_clvnops.c
==============================================================================
--- stable/10/sys/fs/nfsclient/nfs_clvnops.c	Sun Jun 26 12:41:02 2016	(r302207)
+++ stable/10/sys/fs/nfsclient/nfs_clvnops.c	Sun Jun 26 13:16:02 2016	(r302208)
@@ -3098,10 +3098,14 @@ nfs_advlock(struct vop_advlock_args *ap)
 			}
 		}
 		if (error == 0 && ap->a_op == F_SETLK) {
-			/* Mark that a file lock has been acquired. */
-			mtx_lock(&np->n_mtx);
-			np->n_flag |= NHASBEENLOCKED;
-			mtx_unlock(&np->n_mtx);
+			error = NFSVOPLOCK(vp, LK_SHARED);
+			if (error == 0) {
+				/* Mark that a file lock has been acquired. */
+				mtx_lock(&np->n_mtx);
+				np->n_flag |= NHASBEENLOCKED;
+				mtx_unlock(&np->n_mtx);
+				NFSVOPUNLOCK(vp, 0);
+			}
 		}
 	}
 	return (error);



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