kern/165927: commit references a PR

dfilter service dfilter at FreeBSD.ORG
Sat Mar 17 23:10:17 UTC 2012


The following reply was made to PR kern/165927; it has been noted by GNATS.

From: dfilter at FreeBSD.ORG (dfilter service)
To: bug-followup at FreeBSD.org
Cc:  
Subject: Re: kern/165927: commit references a PR
Date: Sat, 17 Mar 2012 23:03:32 +0000 (UTC)

 Author: kib
 Date: Sat Mar 17 23:03:20 2012
 New Revision: 233101
 URL: http://svn.freebsd.org/changeset/base/233101
 
 Log:
   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
   Reviewed by:	alc
   MFC after:	2 weeks
 
 Modified:
   head/sys/fs/nfsclient/nfs_clbio.c
   head/sys/fs/nfsclient/nfs_clvnops.c
 
 Modified: head/sys/fs/nfsclient/nfs_clbio.c
 ==============================================================================
 --- head/sys/fs/nfsclient/nfs_clbio.c	Sat Mar 17 23:00:32 2012	(r233100)
 +++ head/sys/fs/nfsclient/nfs_clbio.c	Sat Mar 17 23:03:20 2012	(r233101)
 @@ -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: head/sys/fs/nfsclient/nfs_clvnops.c
 ==============================================================================
 --- head/sys/fs/nfsclient/nfs_clvnops.c	Sat Mar 17 23:00:32 2012	(r233100)
 +++ head/sys/fs/nfsclient/nfs_clvnops.c	Sat Mar 17 23:03:20 2012	(r233101)
 @@ -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
 _______________________________________________
 svn-src-all at freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe at freebsd.org"
 


More information about the freebsd-bugs mailing list