Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Sep 2019 13:26:27 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r352393 - head/sys/fs/nfsclient
Message-ID:  <201909161326.x8GDQRdl084854@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Mon Sep 16 13:26:27 2019
New Revision: 352393
URL: https://svnweb.freebsd.org/changeset/base/352393

Log:
  nfscl_loadattrcache: fix rest of the cases to not call
  vnode_pager_setsize() under the node mutex.
  
  r248567 moved some calls of vnode_pager_setsize() after the node lock
  is unlocked, do the rest now.
  
  Reported and tested by:	peterj
  Sponsored by:	The FreeBSD Foundation
  MFC after:	1 week

Modified:
  head/sys/fs/nfsclient/nfs_clport.c

Modified: head/sys/fs/nfsclient/nfs_clport.c
==============================================================================
--- head/sys/fs/nfsclient/nfs_clport.c	Mon Sep 16 13:10:34 2019	(r352392)
+++ head/sys/fs/nfsclient/nfs_clport.c	Mon Sep 16 13:26:27 2019	(r352393)
@@ -511,10 +511,10 @@ nfscl_loadattrcache(struct vnode **vpp, struct nfsvatt
 				 * zero np->n_attrstamp to indicate that
 				 * the attributes are stale.
 				 */
-				vap->va_size = np->n_size;
+				nsize = vap->va_size = np->n_size;
+				setnsize = 1;
 				np->n_attrstamp = 0;
 				KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp);
-				vnode_pager_setsize(vp, np->n_size);
 			} else if (np->n_flag & NMODIFIED) {
 				/*
 				 * We've modified the file: Use the larger
@@ -526,7 +526,8 @@ nfscl_loadattrcache(struct vnode **vpp, struct nfsvatt
 					np->n_size = vap->va_size;
 					np->n_flag |= NSIZECHANGED;
 				}
-				vnode_pager_setsize(vp, np->n_size);
+				nsize = np->n_size;
+				setnsize = 1;
 			} else if (vap->va_size < np->n_size) {
 				/*
 				 * When shrinking the size, the call to
@@ -538,9 +539,9 @@ nfscl_loadattrcache(struct vnode **vpp, struct nfsvatt
 				np->n_flag |= NSIZECHANGED;
 				setnsize = 1;
 			} else {
-				np->n_size = vap->va_size;
+				nsize = np->n_size = vap->va_size;
 				np->n_flag |= NSIZECHANGED;
-				vnode_pager_setsize(vp, np->n_size);
+				setnsize = 1;
 			}
 		} else {
 			np->n_size = vap->va_size;



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