Here's the right version, sorry. This still potentially decrements
elevator sequence wrongly for a missed front merge, but that's an issue
I can definitely live with :-)
--- /opt/kernel/linux-2.4.18-pre3/drivers/block/ll_rw_blk.c Tue Jan 15 14:06:13 2002
+++ drivers/block/ll_rw_blk.c Tue Jan 15 14:54:20 2002
@@ -694,10 +694,11 @@
switch (el_ret) {
case ELEVATOR_BACK_MERGE:
- if (!q->back_merge_fn(q, req, bh, max_segments)) {
- insert_here = &req->queue;
+ insert_here = &req->queue;
+ if (req->current_nr_sectors != count)
+ break;
+ if (!q->back_merge_fn(q, req, bh, max_segments))
break;
- }
elevator->elevator_merge_cleanup_fn(q, req, count);
req->bhtail->b_reqnext = bh;
req->bhtail = bh;
@@ -708,10 +709,11 @@
goto out;
case ELEVATOR_FRONT_MERGE:
- if (!q->front_merge_fn(q, req, bh, max_segments)) {
- insert_here = req->queue.prev;
+ insert_here = req->queue.prev;
+ if (req->current_nr_sectors != count)
+ break;
+ if (!q->front_merge_fn(q, req, bh, max_segments))
break;
- }
elevator->elevator_merge_cleanup_fn(q, req, count);
bh->b_reqnext = req->bh;
req->bh = bh;
-- Jens Axboe- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/