Skip to content

Commit

Permalink
blk-mq: mq plug list breakage
Browse files Browse the repository at this point in the history
We switched to plug mq_list for mq, but some code are still using old list.

Signed-off-by: Shaohua Li <shli@fusionio.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
shaohuali authored and axboe committed Oct 29, 2013
1 parent 3228f48 commit 92f399c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion block/blk-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1401,13 +1401,19 @@ bool blk_attempt_plug_merge(struct request_queue *q, struct bio *bio,
struct blk_plug *plug;
struct request *rq;
bool ret = false;
struct list_head *plug_list;

plug = current->plug;
if (!plug)
goto out;
*request_count = 0;

list_for_each_entry_reverse(rq, &plug->list, queuelist) {
if (q->mq_ops)
plug_list = &plug->mq_list;
else
plug_list = &plug->list;

list_for_each_entry_reverse(rq, plug_list, queuelist) {
int el_ret;

if (rq->q == q)
Expand Down
2 changes: 1 addition & 1 deletion block/blk-mq.c
Original file line number Diff line number Diff line change
Expand Up @@ -950,7 +950,7 @@ static void blk_mq_make_request(struct request_queue *q, struct bio *bio)

if (plug) {
blk_mq_bio_to_request(rq, bio);
if (list_empty(&plug->list))
if (list_empty(&plug->mq_list))
trace_block_plug(q);
else if (request_count >= BLK_MAX_REQUEST_COUNT) {
blk_flush_plug_list(plug, false);
Expand Down

0 comments on commit 92f399c

Please sign in to comment.