block: Exclude conventional zones when faking max open limit
authorDamien Le Moal <dlemoal@kernel.org>
Wed, 1 May 2024 11:08:55 +0000 (20:08 +0900)
committerJens Axboe <axboe@kernel.dk>
Wed, 1 May 2024 14:08:42 +0000 (08:08 -0600)
commit6b7593b5fb9eb73be92f78a1abfa502f05ff5e15
tree8331b352211065322aebc06a4604fdef2e5086f4
parent44cccb3027d4719c9229203233250d73d3192bf9
block: Exclude conventional zones when faking max open limit

For a device that has no limits for the maximum number of open and
active zones, we default to using the number of zones, limited to
BLK_ZONE_WPLUG_DEFAULT_POOL_SIZE (128), for the maximum number of open
zones indicated to the user. However, for a device that has conventional
zones and less zones than BLK_ZONE_WPLUG_DEFAULT_POOL_SIZE, we should
not account conventional zones and set the limit to the number of
sequential write required zones. Furthermore, for cases where the limit
is equal to the number of sequential write required zones, we can
advertize a limit of 0 to indicate "no limits".

Fix this by moving the zone write plug mempool resizing from
disk_revalidate_zone_resources() to disk_update_zone_resources() where
we can safely compute the number of conventional zones and update the
limits.

Fixes: 843283e96e5a ("block: Fake max open zones limit when there is no limit")
Reported-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Link: https://lore.kernel.org/r/20240501110907.96950-3-dlemoal@kernel.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-zoned.c