From 276f72c550c0faf0cbfd5fa737c4d5d452a38b35 Mon Sep 17 00:00:00 2001 From: Poul-Henning Kamp Date: Wed, 6 Oct 2004 20:59:59 +0000 Subject: [PATCH] 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. --- sys/geom/geom_io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/geom/geom_io.c b/sys/geom/geom_io.c index eb10b793115d..188d78f50ad2 100644 --- a/sys/geom/geom_io.c +++ b/sys/geom/geom_io.c @@ -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);