summaryrefslogtreecommitdiffstats
path: root/sys/nfsclient/nfs_bio.c
diff options
context:
space:
mode:
authordfr <dfr@FreeBSD.org>1996-07-16 10:19:45 +0000
committerdfr <dfr@FreeBSD.org>1996-07-16 10:19:45 +0000
commit90a643ddb4048ff6bfea37ed866b1d890d6e177f (patch)
treec09adb4e15413a694fad7e62a52249b526659ec7 /sys/nfsclient/nfs_bio.c
parent96a4925288045b01e89e5fad53384551ec332380 (diff)
downloadFreeBSD-src-90a643ddb4048ff6bfea37ed866b1d890d6e177f.zip
FreeBSD-src-90a643ddb4048ff6bfea37ed866b1d890d6e177f.tar.gz
Various fixes from frank@fwi.uva.nl (Frank van der Linden) via
rick@snowhite.cis.uoguelph.ca: 1. Clear B_NEEDCOMMIT in nfs_write to make sure that dirty data is correctly send to the server. If a buffer was dirtied when it was in the B_DELWRI+B_NEEDCOMMIT state, the state of the buffer was left unchanged and when the buffer was later cleaned, just a commit rpc was made to the server to complete the previous write. Clearing B_NEEDCOMMIT ensures that another write is made to the server. 2. If a server returned a server (for whatever reason) returned an answer to a write RPC that implied that fewer bytes than requested were written, bad things would happen. 3. The setattr operation passed on the atime in stead of the mtime to the server. The fix is trivial. 4. XIDs always started at 0, but this caused some servers (older DEC OSF/1 3.0 so I've been told) who had very long-lasting XID caches to get confused if, after a reboot of a BSD client, RPCs came in with a XID that had in the past been used before from that client. Patch is to use the current time in seconds as a starting point for XIDs. The patch below is not perfect, because it requires the root fs to be mounted first. This is because of the check BSD systems do, comparing FS time to system time. Reviewed by: Bruce Evans, Terry Lambert. Obtained from: frank@fwi.uva.nl (Frank van der Linden) via rick@snowhite.cis.uoguelph.ca
Diffstat (limited to 'sys/nfsclient/nfs_bio.c')
-rw-r--r--sys/nfsclient/nfs_bio.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/nfsclient/nfs_bio.c b/sys/nfsclient/nfs_bio.c
index b5b7668..d1bb47e 100644
--- a/sys/nfsclient/nfs_bio.c
+++ b/sys/nfsclient/nfs_bio.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_bio.c 8.5 (Berkeley) 1/4/94
- * $Id: nfs_bio.c,v 1.22 1996/01/24 18:52:18 mpp Exp $
+ * $Id: nfs_bio.c,v 1.23 1996/06/08 05:59:04 pst Exp $
*/
#include <sys/param.h>
@@ -584,6 +584,13 @@ again:
bp->b_validoff = min(bp->b_validoff, bp->b_dirtyoff);
bp->b_validend = max(bp->b_validend, bp->b_dirtyend);
}
+
+ /*
+ * Since this block is being modified, it must be written
+ * again and not just committed.
+ */
+ bp->b_flags &= ~B_NEEDCOMMIT;
+
/*
* If the lease is non-cachable or IO_SYNC do bwrite().
*/
OpenPOWER on IntegriCloud