From: miod Date: Sun, 18 Jan 2015 14:01:54 +0000 (+0000) Subject: Revert 1.166 (but keep the bufq_wait() interface change), for this is wrong X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=739b1a7edab304dc058452a6895f7c6c82aef505;p=openbsd Revert 1.166 (but keep the bufq_wait() interface change), for this is wrong and the bufq pointer might be NULL at the time it is `saved'. Found the hard way on sparc due to the limited kva, with all disk active processes ending up sleeping on "buf_needva". ok kettenis@ krw@ --- diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index e7736942948..c7da9149991 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_bio.c,v 1.166 2015/01/09 05:04:22 tedu Exp $ */ +/* $OpenBSD: vfs_bio.c,v 1.167 2015/01/18 14:01:54 miod Exp $ */ /* $NetBSD: vfs_bio.c,v 1.44 1996/06/11 11:15:36 pk Exp $ */ /* @@ -516,7 +516,6 @@ bwrite(struct buf *bp) int rv, async, wasdelayed, s; struct vnode *vp; struct mount *mp; - struct bufq *bq; vp = bp->b_vp; if (vp != NULL) @@ -570,7 +569,6 @@ bwrite(struct buf *bp) /* Initiate disk write. Make sure the appropriate party is charged. */ bp->b_vp->v_numoutput++; - bq = bp->b_bq; splx(s); SET(bp->b_flags, B_WRITEINPROG); VOP_STRATEGY(bp); @@ -580,8 +578,8 @@ bwrite(struct buf *bp) * the number of outstanding write bufs drops below the low * water mark. */ - if (bq) - bufq_wait(bq); + if (bp->b_bq) + bufq_wait(bp->b_bq); if (async) return (0);