mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2025-01-11 17:04:19 +01:00
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:
parent
b36c1562e1
commit
61da17a62c
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=43705
@ -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.
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user