in getnewbuf(), when we need to write a buffer before reusing it,
return NULL instead of restarting the loop since we might sleep while starting the i/o. this tells getblk() to check if someone else created the buffer while we slept. from OpenBSD.
This commit is contained in:
parent
63f7d31eeb
commit
941da355cf
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: vfs_bio.c,v 1.74 2000/12/13 17:48:46 jdolecek Exp $ */
|
/* $NetBSD: vfs_bio.c,v 1.75 2001/03/10 18:43:55 chs Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1994 Christopher G. Demetriou
|
* Copyright (c) 1994 Christopher G. Demetriou
|
||||||
|
@ -830,7 +830,10 @@ start:
|
||||||
/* Buffer is no longer on free lists. */
|
/* Buffer is no longer on free lists. */
|
||||||
SET(bp->b_flags, B_BUSY);
|
SET(bp->b_flags, B_BUSY);
|
||||||
|
|
||||||
/* If buffer was a delayed write, start it, and go back to the top. */
|
/*
|
||||||
|
* If buffer was a delayed write, start it and return NULL
|
||||||
|
* (since we might sleep while starting the write).
|
||||||
|
*/
|
||||||
if (ISSET(bp->b_flags, B_DELWRI)) {
|
if (ISSET(bp->b_flags, B_DELWRI)) {
|
||||||
splx(s);
|
splx(s);
|
||||||
/*
|
/*
|
||||||
|
@ -839,7 +842,7 @@ start:
|
||||||
*/
|
*/
|
||||||
SET(bp->b_flags, B_AGE);
|
SET(bp->b_flags, B_AGE);
|
||||||
bawrite(bp);
|
bawrite(bp);
|
||||||
goto start;
|
return (NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* disassociate us from our vnode, if we had one... */
|
/* disassociate us from our vnode, if we had one... */
|
||||||
|
|
Loading…
Reference in New Issue