From: Jens Axboe <axboe@kernel.dk>
To: linux-block@vger.kernel.org
Cc: Jens Axboe <axboe@kernel.dk>
Subject: [PATCH 5/5] block: ensure cached plug request matches the current queue
Date: Thu, 4 Nov 2021 09:22:04 -0600 [thread overview]
Message-ID: <20211104152204.57360-6-axboe@kernel.dk> (raw)
In-Reply-To: <20211104152204.57360-1-axboe@kernel.dk>
If we're driving multiple devices, we could have pre-populated the cache
for a different device. Ensure that the empty request matches the current
queue.
Fixes: 47c122e35d7e ("block: pre-allocate requests if plug is started and is a batch")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
---
block/blk-mq.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/block/blk-mq.c b/block/blk-mq.c
index b0c0eac43eef..e9397bcdd90c 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -2487,7 +2487,7 @@ static inline struct request *blk_get_plug_request(struct request_queue *q,
if (!plug)
return NULL;
rq = rq_list_peek(&plug->cached_rq);
- if (!rq)
+ if (!rq || rq->q != q)
return NULL;
if (unlikely(!submit_bio_checks(bio)))
return ERR_PTR(-EIO);
--
2.33.1
next prev parent reply other threads:[~2021-11-04 15:22 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-04 15:21 [PATCHSET v2 0/5] Alloc batch fixes Jens Axboe
2021-11-04 15:22 ` [PATCH 1/5] block: have plug stored requests hold references to the queue Jens Axboe
2021-11-04 15:22 ` [PATCH 2/5] block: make blk_try_enter_queue() available for blk-mq Jens Axboe
2021-11-04 15:22 ` [PATCH 3/5] block: move plug rq alloc into helper Jens Axboe
2021-11-04 15:22 ` [PATCH 4/5] block: move queue enter logic into blk_mq_submit_bio() Jens Axboe
2021-11-04 15:22 ` Jens Axboe [this message]
-- strict thread matches above, loose matches on Subject: below --
2021-11-04 18:21 [PATCHSET v3 0/5] Alloc batch fixes Jens Axboe
2021-11-04 18:22 ` [PATCH 5/5] block: ensure cached plug request matches the current queue Jens Axboe
2021-11-04 18:36 ` Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211104152204.57360-6-axboe@kernel.dk \
--to=axboe@kernel.dk \
--cc=linux-block@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.