1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-18 15:30:21 +00:00

Fixed a panic in nfs_writevp(). Lite2 provided a fix for a silly

missing-parentheses bug, but this exposed a misplaced vfs_busy_pages().
This bug cost a factor of 2.5-3 in nfsv3 write performance!  It should
be fixed in 2.2.

Removed some debugging code that gets triggered often in normal
operation.  There are still many backwards diagnostics (#define
DIAGNOSTIC gives no diagnostics).

Submitted by:	vfs_busy_pages() fix by dfr
This commit is contained in:
Bruce Evans 1997-02-28 17:56:27 +00:00
parent 85cf4b8e56
commit 2ca8d13195
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=23218
2 changed files with 4 additions and 10 deletions

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_vnops.c 8.16 (Berkeley) 5/27/95
* $Id$
* $Id: nfs_vnops.c,v 1.42 1997/02/22 09:42:46 peter Exp $
*/
@ -2917,9 +2917,6 @@ nfs_flush(vp, cred, waitfor, p, commit)
}
}
if (vp->v_dirtyblkhd.lh_first && commit) {
#ifndef DIAGNOSTIC
vprint("nfs_fsync: dirty", vp);
#endif
goto loop;
}
}
@ -3128,6 +3125,7 @@ nfs_writebp(bp, force)
* an actual write will have to be scheduled via. VOP_STRATEGY().
* If B_WRITEINPROG is already set, then push it with a write anyhow.
*/
vfs_busy_pages(bp, 1);
if ((oldflags & (B_NEEDCOMMIT | B_WRITEINPROG)) == B_NEEDCOMMIT) {
off = ((u_quad_t)bp->b_blkno) * DEV_BSIZE + bp->b_dirtyoff;
bp->b_flags |= B_WRITEINPROG;
@ -3144,7 +3142,6 @@ nfs_writebp(bp, force)
if (retv) {
if (force)
bp->b_flags |= B_WRITEINPROG;
vfs_busy_pages(bp, 1);
VOP_STRATEGY(bp);
}

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_vnops.c 8.16 (Berkeley) 5/27/95
* $Id$
* $Id: nfs_vnops.c,v 1.42 1997/02/22 09:42:46 peter Exp $
*/
@ -2917,9 +2917,6 @@ nfs_flush(vp, cred, waitfor, p, commit)
}
}
if (vp->v_dirtyblkhd.lh_first && commit) {
#ifndef DIAGNOSTIC
vprint("nfs_fsync: dirty", vp);
#endif
goto loop;
}
}
@ -3128,6 +3125,7 @@ nfs_writebp(bp, force)
* an actual write will have to be scheduled via. VOP_STRATEGY().
* If B_WRITEINPROG is already set, then push it with a write anyhow.
*/
vfs_busy_pages(bp, 1);
if ((oldflags & (B_NEEDCOMMIT | B_WRITEINPROG)) == B_NEEDCOMMIT) {
off = ((u_quad_t)bp->b_blkno) * DEV_BSIZE + bp->b_dirtyoff;
bp->b_flags |= B_WRITEINPROG;
@ -3144,7 +3142,6 @@ nfs_writebp(bp, force)
if (retv) {
if (force)
bp->b_flags |= B_WRITEINPROG;
vfs_busy_pages(bp, 1);
VOP_STRATEGY(bp);
}