blk_mq_run_dispatch_ops() is defined as one macro, and plug->mq_list
will be changed when running 'dispatch_ops', so add one local variable
for holding request queue.
Reported-and-tested-by: Yi Zhang <yi.zhang@redhat.com>
Fixes:
4cafe86c9267 ("blk-mq: run dispatch lock once in case of issuing from list")
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
plug->rq_count = 0;
if (!plug->multiple_queues && !plug->has_elevator && !from_schedule) {
- blk_mq_run_dispatch_ops(plug->mq_list->q,
+ struct request_queue *q = rq_list_peek(&plug->mq_list)->q;
+
+ blk_mq_run_dispatch_ops(q,
blk_mq_plug_issue_direct(plug, false));
if (rq_list_empty(plug->mq_list))
return;