Skip to content

Commit e94d1d0

Browse files
JeffMoyergregkh
authored andcommitted
blk-flush: move the queue kick into
commit e67b77c upstream. A dm-multipath user reported[1] a problem when trying to boot a kernel with commit 4853aba (block: fix flush machinery for stacking drivers with differring flush flags) applied. It turns out that an empty flush request can be sent into blk_insert_flush. When the BUG_ON was fixed to allow for this, I/O on the underlying device would stall. The reason is that blk_insert_cloned_request does not kick the queue. In the aforementioned commit, I had added a special case to kick the queue if data was sent down but the queue flags did not require a flush. A better solution is to push the queue kick up into blk_insert_cloned_request. This patch, along with a follow-on which fixes the BUG_ON, fixes the issue reported. [1] http://www.redhat.com/archives/dm-devel/2011-September/msg00154.html Reported-by: Christophe Saout <christophe@saout.de> Signed-off-by: Jeff Moyer <jmoyer@redhat.com> Acked-by: Tejun Heo <tj@kernel.org> Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
1 parent d16a63a commit e94d1d0

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

‎block/blk-core.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1725,6 +1725,8 @@ int blk_insert_cloned_request(struct request_queue *q, struct request *rq)
17251725
where = ELEVATOR_INSERT_FLUSH;
17261726

17271727
add_acct_request(q, rq, where);
1728+
if (where == ELEVATOR_INSERT_FLUSH)
1729+
__blk_run_queue(q);
17281730
spin_unlock_irqrestore(q->queue_lock, flags);
17291731

17301732
return 0;

‎block/blk-flush.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,6 @@ void blk_insert_flush(struct request *rq)
330330
if ((policy & REQ_FSEQ_DATA) &&
331331
!(policy & (REQ_FSEQ_PREFLUSH | REQ_FSEQ_POSTFLUSH))) {
332332
list_add_tail(&rq->queuelist, &q->queue_head);
333-
blk_run_queue_async(q);
334333
return;
335334
}
336335

0 commit comments

Comments
 (0)