Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 31 Mar 2012 06:50:28 +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-9@freebsd.org
Subject:   svn commit: r233730 - stable/9/sys/fs/nfsclient
Message-ID:  <201203310650.q2V6oSiB088339@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Sat Mar 31 06:50:27 2012
New Revision: 233730
URL: http://svn.freebsd.org/changeset/base/233730

Log:
  MFC r233101:
  Add sysctl vfs.nfs.nfs_keep_dirty_on_error to switch the nfs client
  behaviour on error from write RPC back to behaviour of old nfs client.
  When set to not zero, the pages for which write failed are kept dirty.
  
  PR:	kern/165927

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

Modified: stable/9/sys/fs/nfsclient/nfs_clbio.c
==============================================================================
--- stable/9/sys/fs/nfsclient/nfs_clbio.c	Sat Mar 31 06:48:41 2012	(r233729)
+++ stable/9/sys/fs/nfsclient/nfs_clbio.c	Sat Mar 31 06:50:27 2012	(r233730)
@@ -66,6 +66,7 @@ extern int ncl_numasync;
 extern enum nfsiod_state ncl_iodwant[NFS_MAXASYNCDAEMON];
 extern struct nfsmount *ncl_iodmount[NFS_MAXASYNCDAEMON];
 extern int newnfs_directio_enable;
+extern int nfs_keep_dirty_on_error;
 
 int ncl_pbuf_freecnt = -1;	/* start out unlimited */
 
@@ -348,9 +349,11 @@ ncl_putpages(struct vop_putpages_args *a
 	pmap_qremove(kva, npages);
 	relpbuf(bp, &ncl_pbuf_freecnt);
 
-	vnode_pager_undirty_pages(pages, rtvals, count - uio.uio_resid);
-	if (must_commit)
-		ncl_clearcommit(vp->v_mount);
+	if (error == 0 || !nfs_keep_dirty_on_error) {
+		vnode_pager_undirty_pages(pages, rtvals, count - uio.uio_resid);
+		if (must_commit)
+			ncl_clearcommit(vp->v_mount);
+	}
 	return rtvals[0];
 }
 

Modified: stable/9/sys/fs/nfsclient/nfs_clvnops.c
==============================================================================
--- stable/9/sys/fs/nfsclient/nfs_clvnops.c	Sat Mar 31 06:48:41 2012	(r233729)
+++ stable/9/sys/fs/nfsclient/nfs_clvnops.c	Sat Mar 31 06:50:27 2012	(r233730)
@@ -241,6 +241,10 @@ int newnfs_directio_enable = 0;
 SYSCTL_INT(_vfs_nfs, OID_AUTO, nfs_directio_enable, CTLFLAG_RW,
 	   &newnfs_directio_enable, 0, "Enable NFS directio");
 
+int nfs_keep_dirty_on_error;
+SYSCTL_INT(_vfs_nfs, OID_AUTO, nfs_keep_dirty_on_error, CTLFLAG_RW,
+    &nfs_keep_dirty_on_error, 0, "Retry pageout if error returned");
+
 /*
  * This sysctl allows other processes to mmap a file that has been opened
  * O_DIRECT by a process.  In general, having processes mmap the file while



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