Don't set the BIO_ONQUEUE debugging flag until we actually put the bio

onto a queue.  This made the ENOMEM handling an instant panic.
This commit is contained in:
Poul-Henning Kamp 2004-10-06 20:59:59 +00:00
parent 3a5f9a2bd2
commit 276f72c550

View File

@ -313,7 +313,6 @@ g_io_deliver(struct bio *bp, int error)
KASSERT(!(bp->bio_flags & BIO_ONQUEUE),
("Bio already on queue bp=%p", bp));
bp->bio_flags |= BIO_ONQUEUE;
/*
* XXX: next two doesn't belong here
@ -334,6 +333,7 @@ g_io_deliver(struct bio *bp, int error)
if (error != ENOMEM) {
bp->bio_error = error;
TAILQ_INSERT_TAIL(&g_bio_run_up.bio_queue, bp, bio_queue);
bp->bio_flags |= BIO_ONQUEUE;
g_bio_run_up.bio_queue_length++;
g_bioq_unlock(&g_bio_run_up);
wakeup(&g_wait_up);