diff options
author | Mike Snitzer <msnitzer@redhat.com> | 2014-03-08 22:19:20 -0500 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2014-03-08 22:31:31 -0500 |
commit | 10beafc190abcc4ad64024a053441520ba116127 (patch) | |
tree | ab36c3d76a426d4a195e9344b8b323daba04f689 /block/blk-flush.c | |
parent | 7982e90c3a574c90b51aa1c77404e7e6189d58d5 (diff) |
block: change flush sequence list addition back to front add
Commit 18741986 inadvertently changed the rq flush insertion
from a head to a tail insertion. Fix that back up.
Signed-off-by: Mike Snitzer <msnitzer@redhat.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'block/blk-flush.c')
-rw-r--r-- | block/blk-flush.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/block/blk-flush.c b/block/blk-flush.c index f598f794c3c6..43e6b4755e9a 100644 --- a/block/blk-flush.c +++ b/block/blk-flush.c | |||
@@ -140,14 +140,17 @@ static void mq_flush_run(struct work_struct *work) | |||
140 | blk_mq_insert_request(rq, false, true, false); | 140 | blk_mq_insert_request(rq, false, true, false); |
141 | } | 141 | } |
142 | 142 | ||
143 | static bool blk_flush_queue_rq(struct request *rq) | 143 | static bool blk_flush_queue_rq(struct request *rq, bool add_front) |
144 | { | 144 | { |
145 | if (rq->q->mq_ops) { | 145 | if (rq->q->mq_ops) { |
146 | INIT_WORK(&rq->mq_flush_work, mq_flush_run); | 146 | INIT_WORK(&rq->mq_flush_work, mq_flush_run); |
147 | kblockd_schedule_work(rq->q, &rq->mq_flush_work); | 147 | kblockd_schedule_work(rq->q, &rq->mq_flush_work); |
148 | return false; | 148 | return false; |
149 | } else { | 149 | } else { |
150 | list_add_tail(&rq->queuelist, &rq->q->queue_head); | 150 | if (add_front) |
151 | list_add(&rq->queuelist, &rq->q->queue_head); | ||
152 | else | ||
153 | list_add_tail(&rq->queuelist, &rq->q->queue_head); | ||
151 | return true; | 154 | return true; |
152 | } | 155 | } |
153 | } | 156 | } |
@@ -193,7 +196,7 @@ static bool blk_flush_complete_seq(struct request *rq, unsigned int seq, | |||
193 | 196 | ||
194 | case REQ_FSEQ_DATA: | 197 | case REQ_FSEQ_DATA: |
195 | list_move_tail(&rq->flush.list, &q->flush_data_in_flight); | 198 | list_move_tail(&rq->flush.list, &q->flush_data_in_flight); |
196 | queued = blk_flush_queue_rq(rq); | 199 | queued = blk_flush_queue_rq(rq, true); |
197 | break; | 200 | break; |
198 | 201 | ||
199 | case REQ_FSEQ_DONE: | 202 | case REQ_FSEQ_DONE: |
@@ -326,7 +329,7 @@ static bool blk_kick_flush(struct request_queue *q) | |||
326 | q->flush_rq->rq_disk = first_rq->rq_disk; | 329 | q->flush_rq->rq_disk = first_rq->rq_disk; |
327 | q->flush_rq->end_io = flush_end_io; | 330 | q->flush_rq->end_io = flush_end_io; |
328 | 331 | ||
329 | return blk_flush_queue_rq(q->flush_rq); | 332 | return blk_flush_queue_rq(q->flush_rq, false); |
330 | } | 333 | } |
331 | 334 | ||
332 | static void flush_data_end_io(struct request *rq, int error) | 335 | static void flush_data_end_io(struct request *rq, int error) |