All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] block: null_blk: only set set->nr_maps as 3 if active poll_queues is > 0
@ 2021-12-24  1:08 Ming Lei
  2021-12-24  4:28 ` Shinichiro Kawasaki
  2021-12-24  5:06 ` Jens Axboe
  0 siblings, 2 replies; 3+ messages in thread
From: Ming Lei @ 2021-12-24  1:08 UTC (permalink / raw)
  To: Jens Axboe; +Cc: linux-block, Ming Lei, Shinichiro Kawasaki

It isn't correct to set set->nr_maps as 3 if g_poll_queues is > 0 since
we can change it via configfs for null_blk device created there, so only
set it as 3 if active poll_queues is > 0.

Fixes divide zero exception reported by Shinichiro.

Fixes: 2bfdbe8b7ebd ("null_blk: allow zero poll queues")
Reported-by: Shinichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
---
 drivers/block/null_blk/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/block/null_blk/main.c b/drivers/block/null_blk/main.c
index 6be6ccd4a28f..13004beb48ca 100644
--- a/drivers/block/null_blk/main.c
+++ b/drivers/block/null_blk/main.c
@@ -1892,7 +1892,7 @@ static int null_init_tag_set(struct nullb *nullb, struct blk_mq_tag_set *set)
 	if (g_shared_tag_bitmap)
 		set->flags |= BLK_MQ_F_TAG_HCTX_SHARED;
 	set->driver_data = nullb;
-	if (g_poll_queues)
+	if (poll_queues)
 		set->nr_maps = 3;
 	else
 		set->nr_maps = 1;
-- 
2.31.1


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

* Re: [PATCH] block: null_blk: only set set->nr_maps as 3 if active poll_queues is > 0
  2021-12-24  1:08 [PATCH] block: null_blk: only set set->nr_maps as 3 if active poll_queues is > 0 Ming Lei
@ 2021-12-24  4:28 ` Shinichiro Kawasaki
  2021-12-24  5:06 ` Jens Axboe
  1 sibling, 0 replies; 3+ messages in thread
From: Shinichiro Kawasaki @ 2021-12-24  4:28 UTC (permalink / raw)
  To: Ming Lei; +Cc: Jens Axboe, linux-block

On Dec 24, 2021 / 09:08, Ming Lei wrote:
> It isn't correct to set set->nr_maps as 3 if g_poll_queues is > 0 since
> we can change it via configfs for null_blk device created there, so only
> set it as 3 if active poll_queues is > 0.
> 
> Fixes divide zero exception reported by Shinichiro.
> 
> Fixes: 2bfdbe8b7ebd ("null_blk: allow zero poll queues")
> Reported-by: Shinichiro Kawasaki <shinichiro.kawasaki@wdc.com>
> Signed-off-by: Ming Lei <ming.lei@redhat.com>

Thanks for the fix. It looks good to me. Also, I confirmed the divide zero
exception is avoided with this patch.

Reviewed-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>

-- 
Best Regards,
Shin'ichiro Kawasaki

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

* Re: [PATCH] block: null_blk: only set set->nr_maps as 3 if active poll_queues is > 0
  2021-12-24  1:08 [PATCH] block: null_blk: only set set->nr_maps as 3 if active poll_queues is > 0 Ming Lei
  2021-12-24  4:28 ` Shinichiro Kawasaki
@ 2021-12-24  5:06 ` Jens Axboe
  1 sibling, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2021-12-24  5:06 UTC (permalink / raw)
  To: Ming Lei; +Cc: Shinichiro Kawasaki, linux-block

On Fri, 24 Dec 2021 09:08:31 +0800, Ming Lei wrote:
> It isn't correct to set set->nr_maps as 3 if g_poll_queues is > 0 since
> we can change it via configfs for null_blk device created there, so only
> set it as 3 if active poll_queues is > 0.
> 
> Fixes divide zero exception reported by Shinichiro.
> 
> 
> [...]

Applied, thanks!

[1/1] block: null_blk: only set set->nr_maps as 3 if active poll_queues is > 0
      commit: 19768f80cf23834e65482f1667ff54192d469fee

Best regards,
-- 
Jens Axboe



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

end of thread, other threads:[~2021-12-24  5:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-24  1:08 [PATCH] block: null_blk: only set set->nr_maps as 3 if active poll_queues is > 0 Ming Lei
2021-12-24  4:28 ` Shinichiro Kawasaki
2021-12-24  5:06 ` 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.