aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Dillon <dillon@FreeBSD.org>1999-02-08 18:27:30 +0000
committerMatthew Dillon <dillon@FreeBSD.org>1999-02-08 18:27:30 +0000
commitd4f72996aefa71bfeb6144d22bd4a51a6cba3d9d (patch)
tree45e8dff30f079c4b1d45ae51479a592a44929198
parent31e08fc3e24c7227a924e79ce34a19ac38b15186 (diff)
Notes
-rw-r--r--sys/nfs/nfs_vnops.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/sys/nfs/nfs_vnops.c b/sys/nfs/nfs_vnops.c
index c1a50d332689..b0655b4abfd5 100644
--- a/sys/nfs/nfs_vnops.c
+++ b/sys/nfs/nfs_vnops.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_vnops.c 8.16 (Berkeley) 5/27/95
- * $Id: nfs_vnops.c,v 1.116 1999/01/12 12:39:14 eivind Exp $
+ * $Id: nfs_vnops.c,v 1.116.2.1 1999/01/28 06:13:27 msmith Exp $
*/
@@ -1567,6 +1567,19 @@ nfs_rename(ap)
}
/*
+ * We have to flush B_DELWRI data prior to renaming
+ * the file. If we don't, the delayed-write buffers
+ * can be flushed out later after the file has gone stale
+ * under NFSV3. NFSV2 does not have this problem because
+ * ( as far as I can tell ) it flushes dirty buffers more
+ * often.
+ */
+
+ VOP_FSYNC(fvp, fcnp->cn_cred, MNT_WAIT, fcnp->cn_proc);
+ if (tvp)
+ VOP_FSYNC(tvp, tcnp->cn_cred, MNT_WAIT, tcnp->cn_proc);
+
+ /*
* If the tvp exists and is in use, sillyrename it before doing the
* rename of the new file over it.
* XXX Can't sillyrename a directory.