Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 8 Apr 1997 13:54:00 +0100 (BST)
From:      Doug Rabson <dfr@nlsystems.com>
To:        current@freebsd.org
Subject:   Fixes to NFSv3 for review
Message-ID:  <Pine.BSF.3.95q.970408134801.4123G-100000@herring.nlsystems.com>

next in thread | raw e-mail | index | archive | help
I recently added code to NFS to use write clustering for NFSv3 commits.
This improves write performance for NFSv3 considerably.  Unfortunately, it
also had a bug which was triggered by code which write many small blocks.
The symptom which I saw was a panic("nfsbioread") when performing a make
world on a machine with NFS mounted src and obj.

I have a fix but I am going on holiday tomorrow for a week and I don't
want to commit anything without being around to deal with any subsequent
problems.  Could someone review and possibly commit this fix.  The bug is
present in both 2.2 and 3.0 branches.

Index: nfs/nfs_bio.c
===================================================================
RCS file: /home/ncvs/src/sys/nfs/nfs_bio.c,v
retrieving revision 1.34
diff -u -r1.34 nfs_bio.c
--- nfs_bio.c	1997/04/03 07:52:00	1.34
+++ nfs_bio.c	1997/04/08 11:41:17
@@ -962,9 +962,12 @@
 		    iomode = NFSV3WRITE_FILESYNC;
 		bp->b_flags |= B_WRITEINPROG;
 		error = nfs_writerpc(vp, uiop, cr, &iomode, &must_commit);
-		if (!error && iomode == NFSV3WRITE_UNSTABLE)
-		    bp->b_flags |= B_NEEDCOMMIT | B_CLUSTEROK;
-		else
+		if (!error && iomode == NFSV3WRITE_UNSTABLE) {
+		    bp->b_flags |= B_NEEDCOMMIT;
+		    if (bp->b_dirtyoff == 0
+			&& bp->b_dirtyend == bp->b_bufsize)
+			bp->b_flags |= B_CLUSTEROK;
+		} else
 		    bp->b_flags &= ~B_NEEDCOMMIT;
 		bp->b_flags &= ~B_WRITEINPROG;
 
Index: kern/vfs_cluster.c
===================================================================
RCS file: /home/ncvs/src/sys/kern/vfs_cluster.c,v
retrieving revision 1.44
diff -u -r1.44 vfs_cluster.c
--- vfs_cluster.c	1997/04/01 11:48:30	1.44
+++ vfs_cluster.c	1997/04/08 11:46:12
@@ -468,6 +468,7 @@
 			tbp->b_flags |= B_ERROR;
 			tbp->b_error = error;
 		}
+		tbp->b_dirtyoff = tbp->b_dirtyend = 0;
 		biodone(tbp);
 	}
 	relpbuf(bp);


--
Doug Rabson				Mail:  dfr@nlsystems.com
Nonlinear Systems Ltd.			Phone: +44 181 951 1891




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.95q.970408134801.4123G-100000>