Only when the front request isn't active is it safe to consider
insertion in front of it. 2.5 does that exactly because it knows if the
request has been started, while 2.4 has to guess by looking at the
head-active flag and the plug status.
If the request is started, we will only consider placing in front of the
2nd request not after the 1st. We could consider in between 1st and 2nd,
that should be safe. In fact that should be perfectly safe, just move
the barrier and started test down after the insert test. *req is the
insert-after point.
diff -Nru a/drivers/block/elevator.c b/drivers/block/elevator.c
--- a/drivers/block/elevator.c Mon May 27 10:53:53 2002
+++ b/drivers/block/elevator.c Mon May 27 10:53:53 2002
@@ -174,9 +174,6 @@
while ((entry = entry->prev) != &q->queue_head) {
__rq = list_entry_rq(entry);
- if (__rq->flags & (REQ_BARRIER | REQ_STARTED))
- break;
-
/*
* simply "aging" of requests in queue
*/
@@ -189,6 +186,9 @@
if (!*req && bio_rq_in_between(bio, __rq, &q->queue_head))
*req = __rq;
+
+ if (__rq->flags & (REQ_BARRIER | REQ_STARTED))
+ break;
if ((ret = elv_try_merge(__rq, bio))) {
if (ret == ELEVATOR_FRONT_MERGE)
-- 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/