Subject: Re: NFSv3 bug
To: Christos Zoulas <christos@zoulas.com>
From: Manuel Bouyer <bouyer@antioche.lip6.fr>
List: tech-kern
Date: 09/26/2002 20:02:13
--/9DWx/yDrRhgMJTb
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Thu, Sep 26, 2002 at 07:56:09PM +0200, Manuel Bouyer wrote:
> Seeing Rick's message I checked XNFS specs. for commit, count == 0 means
> to end of file.
> 

OK, we could just flush the whole file in this case. VOP_FSYNC() with
offset & count to 0 mean flush the whole file.

--
Manuel Bouyer, LIP6, Universite Paris VI.           Manuel.Bouyer@lip6.fr
--

--/9DWx/yDrRhgMJTb
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="diff.nfs1"

Index: nfs_serv.c
===================================================================
RCS file: /cvsroot/syssrc/sys/nfs/nfs_serv.c,v
retrieving revision 1.62
diff -u -r1.62 nfs_serv.c
--- nfs_serv.c	2001/11/10 10:59:09	1.62
+++ nfs_serv.c	2002/09/26 18:00:17
@@ -3010,7 +3010,10 @@
 		return (0);
 	}
 	for_ret = VOP_GETATTR(vp, &bfor, cred, procp);
-	error = VOP_FSYNC(vp, cred, FSYNC_WAIT, off, off + cnt, procp);
+	if (cnt > 0)
+		error = VOP_FSYNC(vp, cred, FSYNC_WAIT, off, off + cnt, procp);
+	else
+		error = VOP_FSYNC(vp, cred, FSYNC_WAIT, 0, 0, procp);
 	aft_ret = VOP_GETATTR(vp, &aft, cred, procp);
 	vput(vp);
 	nfsm_reply(NFSX_V3WCCDATA + NFSX_V3WRITEVERF);

--/9DWx/yDrRhgMJTb--