Fix lockup for loopback NFS mounts. The pipelined I/O limitations could be
hit on the client side and prevent the server side from retiring writes. Pipeline operations turned off for all READs (no big loss since reads are usually synchronous) and for NFS writes, and left on for the default bwrite(). (MFC expected prior to 4.3 freeze) Testing by: mjacob, dillon
This commit is contained in:
parent
fab9e3acac
commit
63692125a9
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=73211
@ -695,6 +695,13 @@ bwrite(struct buf * bp)
|
||||
|
||||
bp->b_vp->v_numoutput++;
|
||||
vfs_busy_pages(bp, 1);
|
||||
|
||||
/*
|
||||
* Normal bwrites pipeline writes
|
||||
*/
|
||||
bp->b_runningbufspace = bp->b_bufsize;
|
||||
runningbufspace += bp->b_runningbufspace;
|
||||
|
||||
if (curproc != PCPU_GET(idleproc))
|
||||
curproc->p_stats->p_ru.ru_oublock++;
|
||||
splx(s);
|
||||
@ -2936,9 +2943,6 @@ vfs_busy_pages(struct buf * bp, int clear_modify)
|
||||
{
|
||||
int i, bogus;
|
||||
|
||||
bp->b_runningbufspace = bp->b_bufsize;
|
||||
runningbufspace += bp->b_runningbufspace;
|
||||
|
||||
if (bp->b_flags & B_VMIO) {
|
||||
struct vnode *vp = bp->b_vp;
|
||||
vm_object_t obj;
|
||||
|
@ -249,9 +249,6 @@ cluster_read(vp, filesize, lblkno, size, cred, totread, seqcount, bpp)
|
||||
#endif
|
||||
if ((bp->b_flags & B_CLUSTER) == 0) {
|
||||
vfs_busy_pages(bp, 0);
|
||||
} else {
|
||||
bp->b_runningbufspace = bp->b_bufsize;
|
||||
runningbufspace += bp->b_runningbufspace;
|
||||
}
|
||||
bp->b_flags &= ~B_INVAL;
|
||||
bp->b_ioflags &= ~BIO_ERROR;
|
||||
@ -289,9 +286,6 @@ cluster_read(vp, filesize, lblkno, size, cred, totread, seqcount, bpp)
|
||||
|
||||
if ((rbp->b_flags & B_CLUSTER) == 0) {
|
||||
vfs_busy_pages(rbp, 0);
|
||||
} else {
|
||||
rbp->b_runningbufspace = rbp->b_bufsize;
|
||||
runningbufspace += rbp->b_runningbufspace;
|
||||
}
|
||||
rbp->b_flags &= ~B_INVAL;
|
||||
rbp->b_ioflags &= ~BIO_ERROR;
|
||||
|
@ -2869,6 +2869,9 @@ nfs_flush(vp, cred, waitfor, p, commit)
|
||||
* NOTE: we are not clearing B_DONE here, so we have
|
||||
* to do it later on in this routine if we intend to
|
||||
* initiate I/O on the bp.
|
||||
*
|
||||
* Note: to avoid loopback deadlocks, we do not
|
||||
* assign b_runningbufspace.
|
||||
*/
|
||||
if (wcred == NULL)
|
||||
wcred = bp->b_wcred;
|
||||
@ -3142,7 +3145,12 @@ nfs_writebp(bp, force, procp)
|
||||
curproc->p_stats->p_ru.ru_oublock++;
|
||||
splx(s);
|
||||
|
||||
/*
|
||||
* Note: to avoid loopback deadlocks, we do not
|
||||
* assign b_runningbufspace.
|
||||
*/
|
||||
vfs_busy_pages(bp, 1);
|
||||
|
||||
if (force)
|
||||
bp->b_flags |= B_WRITEINPROG;
|
||||
BUF_KERNPROC(bp);
|
||||
|
@ -2869,6 +2869,9 @@ nfs_flush(vp, cred, waitfor, p, commit)
|
||||
* NOTE: we are not clearing B_DONE here, so we have
|
||||
* to do it later on in this routine if we intend to
|
||||
* initiate I/O on the bp.
|
||||
*
|
||||
* Note: to avoid loopback deadlocks, we do not
|
||||
* assign b_runningbufspace.
|
||||
*/
|
||||
if (wcred == NULL)
|
||||
wcred = bp->b_wcred;
|
||||
@ -3142,7 +3145,12 @@ nfs_writebp(bp, force, procp)
|
||||
curproc->p_stats->p_ru.ru_oublock++;
|
||||
splx(s);
|
||||
|
||||
/*
|
||||
* Note: to avoid loopback deadlocks, we do not
|
||||
* assign b_runningbufspace.
|
||||
*/
|
||||
vfs_busy_pages(bp, 1);
|
||||
|
||||
if (force)
|
||||
bp->b_flags |= B_WRITEINPROG;
|
||||
BUF_KERNPROC(bp);
|
||||
|
Loading…
Reference in New Issue
Block a user