Flush delayed-write data out prior to issuing a rename rpc. This appears

to fix the problem w/ NFSV3 whereby a make installworld would get into
    high-network-bandwidth situations continuously trying to retry nfs writes
    that fail with a 'stale file handle' error.
This commit is contained in:
Matthew Dillon 1999-02-06 07:48:56 +00:00
parent b36c1562e1
commit 61da17a62c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=43705
2 changed files with 28 additions and 2 deletions

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_vnops.c 8.16 (Berkeley) 5/27/95
* $Id: nfs_vnops.c,v 1.118 1999/01/27 22:45:13 dillon Exp $
* $Id: nfs_vnops.c,v 1.119 1999/01/27 22:45:49 dillon Exp $
*/
@ -1566,6 +1566,19 @@ nfs_rename(ap)
goto out;
}
/*
* 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.

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_vnops.c 8.16 (Berkeley) 5/27/95
* $Id: nfs_vnops.c,v 1.118 1999/01/27 22:45:13 dillon Exp $
* $Id: nfs_vnops.c,v 1.119 1999/01/27 22:45:49 dillon Exp $
*/
@ -1566,6 +1566,19 @@ nfs_rename(ap)
goto out;
}
/*
* 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.