]> git.baikalelectronics.ru Git - kernel.git/commitdiff
Revert "blk-flush: Queue through IO scheduler when flush not required"
authorJens Axboe <axboe@fb.com>
Wed, 25 Nov 2015 17:12:54 +0000 (10:12 -0700)
committerJens Axboe <axboe@fb.com>
Wed, 25 Nov 2015 17:12:54 +0000 (10:12 -0700)
This reverts commit 0c64202272f1204dac071eb3ac3187b2ea7ca2e7.

Jan writes:

--

Thanks for report! After some investigation I found out we allocate
elevator specific data in __get_request() only for non-flush requests. And
this is actually required since the flush machinery uses the space in
struct request for something else. Doh. So my patch is just wrong and not
easy to fix since at the time __get_request() is called we are not sure
whether the flush machinery will be used in the end. Jens, please revert
0c64202272f1204dac071eb3ac3187b2ea7ca2e7. Thanks!

I'm somewhat surprised that you can reliably hit the race where flushing
gets disabled for the device just while the request is in flight. But I
guess during boot it makes some sense.

--

So let's just revert it, we can fix the queue run manually after the
fact. This race is rare enough that it didn't trigger in testing, it
requires the specific disable-while-in-flight scenario to trigger.

block/blk-flush.c

index c81d56ec308f9b8a9691244aa453aaace171683b..9c423e53324a29c1ba1213c6009822b15d75dac7 100644 (file)
@@ -422,7 +422,7 @@ void blk_insert_flush(struct request *rq)
                if (q->mq_ops) {
                        blk_mq_insert_request(rq, false, false, true);
                } else
-                       q->elevator->type->ops.elevator_add_req_fn(q, rq);
+                       list_add_tail(&rq->queuelist, &q->queue_head);
                return;
        }