From bdcd9f26b0b6b4bd6c6b88232e801bd49826c035 Mon Sep 17 00:00:00 2001 From: Jeff Roberson Date: Wed, 15 Jun 2005 23:32:07 +0000 Subject: [PATCH] - Fix insertions of bios which represent data earlier than anything else in the queue. The insertion sort assumed this had already been taken care of. Spotted by: Antoine Brodin Approved by: re (scottl) --- sys/kern/subr_disk.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/sys/kern/subr_disk.c b/sys/kern/subr_disk.c index c7b6b9421fcd..224882276336 100644 --- a/sys/kern/subr_disk.c +++ b/sys/kern/subr_disk.c @@ -182,15 +182,12 @@ bioq_disksort(bioq, bp) } } else bq = TAILQ_FIRST(&bioq->queue); - + if (bp->bio_offset < bq->bio_offset) { + TAILQ_INSERT_BEFORE(bq, bp, bio_queue); + return; + } /* Insertion sort */ while ((bn = TAILQ_NEXT(bq, bio_queue)) != NULL) { - - /* - * We want to go after the current request if it is the end - * of the first request list, or if the next request is a - * larger cylinder than our request. - */ if (bp->bio_offset < bn->bio_offset) break; bq = bn;