diff options
author | Jeff Roberson <jeff@FreeBSD.org> | 2005-06-15 23:32:07 +0000 |
---|---|---|
committer | Jeff Roberson <jeff@FreeBSD.org> | 2005-06-15 23:32:07 +0000 |
commit | bdcd9f26b0b6b4bd6c6b88232e801bd49826c035 (patch) | |
tree | c06b7af852cf133d3bc1fac483dbe2329440f5df /sys/kern/subr_disk.c | |
parent | c3f967ce8df19ce6c54c333812e20b700d2717a5 (diff) | |
download | src-bdcd9f26b0b6b4bd6c6b88232e801bd49826c035.tar.gz src-bdcd9f26b0b6b4bd6c6b88232e801bd49826c035.zip |
- 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)
Notes
Notes:
svn path=/head/; revision=147406
Diffstat (limited to 'sys/kern/subr_disk.c')
-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 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; |