From: Christoph Hellwig Date: Thu, 13 Apr 2023 06:40:38 +0000 (+0200) Subject: blk-mq: don't plug for head insertions in blk_execute_rq_nowait X-Git-Tag: v6.2.15~299 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2be23ebc92077f9a22e8d0f07d6bfd6dff7ae636;p=thirdparty%2Fkernel%2Fstable.git blk-mq: don't plug for head insertions in blk_execute_rq_nowait [ Upstream commit 50947d7fe9fa6abe3ddc40769dfb02a51c58edb6 ] Plugs never insert at head, so don't plug for head insertions. Fixes: 1c2d2fff6dc0 ("block: wire-up support for passthrough plugging") Signed-off-by: Christoph Hellwig Reviewed-by: Bart Van Assche Reviewed-by: Damien Le Moal Link: https://lore.kernel.org/r/20230413064057.707578-2-hch@lst.de Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- diff --git a/block/blk-mq.c b/block/blk-mq.c index 22d739cf8d326..9f1bafb62973d 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -1345,7 +1345,7 @@ void blk_execute_rq_nowait(struct request *rq, bool at_head) * device, directly accessing the plug instead of using blk_mq_plug() * should not have any consequences. */ - if (current->plug) + if (current->plug && !at_head) blk_add_rq_to_plug(current->plug, rq); else blk_mq_sched_insert_request(rq, at_head, true, false);