diff options
author | jeff <jeff@FreeBSD.org> | 2005-06-15 23:32:07 +0000 |
---|---|---|
committer | jeff <jeff@FreeBSD.org> | 2005-06-15 23:32:07 +0000 |
commit | dec8b83b9d095bd94f7b4578a3a12220aff9a507 (patch) | |
tree | c06b7af852cf133d3bc1fac483dbe2329440f5df | |
parent | e1c499fa2ad11686d4107ff9d4e6f8caeea2ac86 (diff) | |
download | FreeBSD-src-dec8b83b9d095bd94f7b4578a3a12220aff9a507.zip FreeBSD-src-dec8b83b9d095bd94f7b4578a3a12220aff9a507.tar.gz |
- 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)
-rw-r--r-- | sys/kern/subr_disk.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/sys/kern/subr_disk.c b/sys/kern/subr_disk.c index c7b6b94..2248822 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; |