From: Ming Lei Date: Tue, 26 Oct 2021 08:22:57 +0000 (+0800) Subject: blk-mq: don't issue request directly in case that current is to be blocked X-Git-Tag: v6.1-rc5~2683^2~34 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ff1552232b3612edff43a95746a4e78e231ef3d4;p=platform%2Fkernel%2Flinux-starfive.git blk-mq: don't issue request directly in case that current is to be blocked When flushing plug list in case that current will be blocked, we can't issue request directly because ->queue_rq() may sleep, otherwise scheduler may complain. Fixes: dc5fc361d891 ("block: attempt direct issue of plug list") Signed-off-by: Ming Lei Link: https://lore.kernel.org/r/20211026082257.2889890-1-ming.lei@redhat.com Signed-off-by: Jens Axboe --- diff --git a/block/blk-mq.c b/block/blk-mq.c index c19dfa8..9840b15 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -2223,7 +2223,7 @@ void blk_mq_flush_plug_list(struct blk_plug *plug, bool from_schedule) return; plug->rq_count = 0; - if (!plug->multiple_queues && !plug->has_elevator) { + if (!plug->multiple_queues && !plug->has_elevator && !from_schedule) { blk_mq_plug_issue_direct(plug, from_schedule); if (rq_list_empty(plug->mq_list)) return;