All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH for-next] block: fix missing nr_hw_queues update in blk_mq_realloc_tag_set_tags
@ 2022-11-22  8:49 Shin'ichiro Kawasaki
  2022-11-22 11:55 ` Christoph Hellwig
  2022-11-22 13:11 ` Jens Axboe
  0 siblings, 2 replies; 3+ messages in thread
From: Shin'ichiro Kawasaki @ 2022-11-22  8:49 UTC (permalink / raw)
  To: linux-block, Jens Axboe
  Cc: Christoph Hellwig, Chaitanya Kulkarni, Shin'ichiro Kawasaki

The commit ee9d55210c2f ("blk-mq: simplify blk_mq_realloc_tag_set_tags")
cleaned up the function blk_mq_realloc_tag_set_tags. After this change,
the function does not update nr_hw_queues of struct blk_mq_tag_set when
new nr_hw_queues value is smaller than original. This results in failure
of queue number change of block devices. To avoid the failure, add the
missing nr_hw_queues update.

Fixes: ee9d55210c2f ("blk-mq: simplify blk_mq_realloc_tag_set_tags")
Reported-by: Chaitanya Kulkarni <chaitanyak@nvidia.com>
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Link: https://lore.kernel.org/linux-block/20221118140640.featvt3fxktfquwh@shindev/
---
 block/blk-mq.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/block/blk-mq.c b/block/blk-mq.c
index a3a5fb4d4ef6..f72164429446 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -4385,7 +4385,7 @@ static int blk_mq_realloc_tag_set_tags(struct blk_mq_tag_set *set,
 	struct blk_mq_tags **new_tags;
 
 	if (set->nr_hw_queues >= new_nr_hw_queues)
-		return 0;
+		goto done;
 
 	new_tags = kcalloc_node(new_nr_hw_queues, sizeof(struct blk_mq_tags *),
 				GFP_KERNEL, set->numa_node);
@@ -4397,8 +4397,8 @@ static int blk_mq_realloc_tag_set_tags(struct blk_mq_tag_set *set,
 		       sizeof(*set->tags));
 	kfree(set->tags);
 	set->tags = new_tags;
+done:
 	set->nr_hw_queues = new_nr_hw_queues;
-
 	return 0;
 }
 
-- 
2.37.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH for-next] block: fix missing nr_hw_queues update in blk_mq_realloc_tag_set_tags
  2022-11-22  8:49 [PATCH for-next] block: fix missing nr_hw_queues update in blk_mq_realloc_tag_set_tags Shin'ichiro Kawasaki
@ 2022-11-22 11:55 ` Christoph Hellwig
  2022-11-22 13:11 ` Jens Axboe
  1 sibling, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2022-11-22 11:55 UTC (permalink / raw)
  To: Shin'ichiro Kawasaki
  Cc: linux-block, Jens Axboe, Christoph Hellwig, Chaitanya Kulkarni

Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH for-next] block: fix missing nr_hw_queues update in blk_mq_realloc_tag_set_tags
  2022-11-22  8:49 [PATCH for-next] block: fix missing nr_hw_queues update in blk_mq_realloc_tag_set_tags Shin'ichiro Kawasaki
  2022-11-22 11:55 ` Christoph Hellwig
@ 2022-11-22 13:11 ` Jens Axboe
  1 sibling, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2022-11-22 13:11 UTC (permalink / raw)
  To: Shin'ichiro Kawasaki, linux-block
  Cc: Christoph Hellwig, Chaitanya Kulkarni

On Tue, 22 Nov 2022 17:49:17 +0900, Shin'ichiro Kawasaki wrote:
> The commit ee9d55210c2f ("blk-mq: simplify blk_mq_realloc_tag_set_tags")
> cleaned up the function blk_mq_realloc_tag_set_tags. After this change,
> the function does not update nr_hw_queues of struct blk_mq_tag_set when
> new nr_hw_queues value is smaller than original. This results in failure
> of queue number change of block devices. To avoid the failure, add the
> missing nr_hw_queues update.
> 
> [...]

Applied, thanks!

[1/1] block: fix missing nr_hw_queues update in blk_mq_realloc_tag_set_tags
      commit: d4b2e0d433769cb7c87e4c93dc048733388d1c46

Best regards,
-- 
Jens Axboe



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-11-22 13:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-22  8:49 [PATCH for-next] block: fix missing nr_hw_queues update in blk_mq_realloc_tag_set_tags Shin'ichiro Kawasaki
2022-11-22 11:55 ` Christoph Hellwig
2022-11-22 13:11 ` Jens Axboe

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.