aboutsummaryrefslogtreecommitdiffstats
path: root/block/blk-flush.c
diff options
context:
space:
mode:
authorShaohua Li <shli@kernel.org>2014-05-30 10:06:42 -0400
committerJens Axboe <axboe@fb.com>2014-05-30 10:06:42 -0400
commit2230237500821aedfcf2bba2a79d9cbca389233c (patch)
treeb4b7bee385293f8cc318fb309909ca3e701b903b /block/blk-flush.c
parentda52f22fa924b4a21d8e11fbfd3eeebd7a90a366 (diff)
blk-mq: blk_mq_tag_to_rq should handle flush request
flush request is special, which borrows the tag from the parent request. Hence blk_mq_tag_to_rq needs special handling to return the flush request from the tag. Signed-off-by: Shaohua Li <shli@fusionio.com> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'block/blk-flush.c')
-rw-r--r--block/blk-flush.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/block/blk-flush.c b/block/blk-flush.c
index ef608b35d9be..ff87c664b7df 100644
--- a/block/blk-flush.c
+++ b/block/blk-flush.c
@@ -223,8 +223,10 @@ static void flush_end_io(struct request *flush_rq, int error)
223 struct request *rq, *n; 223 struct request *rq, *n;
224 unsigned long flags = 0; 224 unsigned long flags = 0;
225 225
226 if (q->mq_ops) 226 if (q->mq_ops) {
227 spin_lock_irqsave(&q->mq_flush_lock, flags); 227 spin_lock_irqsave(&q->mq_flush_lock, flags);
228 q->flush_rq->cmd_flags = 0;
229 }
228 230
229 running = &q->flush_queue[q->flush_running_idx]; 231 running = &q->flush_queue[q->flush_running_idx];
230 BUG_ON(q->flush_pending_idx == q->flush_running_idx); 232 BUG_ON(q->flush_pending_idx == q->flush_running_idx);