[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1633429419-228500-2-git-send-email-john.garry@huawei.com>
Date: Tue, 5 Oct 2021 18:23:26 +0800
From: John Garry <john.garry@...wei.com>
To: <axboe@...nel.dk>
CC: <linux-block@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<ming.lei@...hat.com>, <hare@...e.de>,
<linux-scsi@...r.kernel.org>, <kashyap.desai@...adcom.com>,
John Garry <john.garry@...wei.com>
Subject: [PATCH v5 01/14] blk-mq: Change rqs check in blk_mq_free_rqs()
The original code in commit 24d2f90309b23 ("blk-mq: split out tag
initialization, support shared tags") would check tags->rqs is non-NULL and
then dereference tags->rqs[].
Then in commit 2af8cbe30531 ("blk-mq: split tag ->rqs[] into two"), we
started to dereference tags->static_rqs[], but continued to check non-NULL
tags->rqs.
Check tags->static_rqs as non-NULL instead, which is more logical.
Signed-off-by: John Garry <john.garry@...wei.com>
Reviewed-by: Ming Lei <ming.lei@...hat.com>
Reviewed-by: Hannes Reinecke <hare@...e.de>
---
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 21bf4c3f0825..bc8238ab1aef 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -2342,7 +2342,7 @@ void blk_mq_free_rqs(struct blk_mq_tag_set *set, struct blk_mq_tags *tags,
{
struct page *page;
- if (tags->rqs && set->ops->exit_request) {
+ if (tags->static_rqs && set->ops->exit_request) {
int i;
for (i = 0; i < tags->nr_tags; i++) {
--
2.26.2
Powered by blists - more mailing lists