Thread (23 messages) 23 messages, 4 authors, 2021-10-08

[PATCH v5 01/14] blk-mq: Change rqs check in blk_mq_free_rqs()

flat view
STALE1835d LANDED: 3 (2M)

From: John Garry <hidden>
Date: 2021-10-05 10:28:58
Also in: linux-scsi, lkml
Subsystem: block layer, the rest · Maintainers: Jens Axboe, Linus Torvalds

Revision v5 of 6 in this series; 2 review trailers; landed in mainline as 65de57bb2e66 on 2021-10-18.

Revisions (6)
  1. v1 [diff vs current]
  2. v2 [diff vs current]
  3. v3 [diff vs current]
  4. v3 [diff vs current]
  5. v4 [diff vs current]
  6. v5 current
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 <redacted>
Reviewed-by: Ming Lei <redacted>
Reviewed-by: Hannes Reinecke <hare@suse.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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help