Skip to content
Commit a1d7c864 authored by Dennis Maisenbacher's avatar Dennis Maisenbacher Committed by Greg Kroah-Hartman
Browse files

nvmet: fix mar and mor off-by-one errors

[ Upstream commit b7e97872 ]

Maximum Active Resources (MAR) and Maximum Open Resources (MOR) are 0's
based vales where a value of 0xffffffff indicates that there is no limit.

Decrement the values that are returned by bdev_max_open_zones and
bdev_max_active_zones as the block layer helpers are not 0's based.
A 0 returned by the block layer helpers indicates no limit, thus convert
it to 0xffffffff (U32_MAX).

Fixes: aaf2e048

 ("nvmet: add ZBD over ZNS backend support")
Suggested-by: default avatarNiklas Cassel <niklas.cassel@wdc.com>
Signed-off-by: default avatarDennis Maisenbacher <dennis.maisenbacher@wdc.com>
Reviewed-by: default avatarChaitanya Kulkarni <kch@nvidia.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent a96b1d33
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment