dm zoned: support zone sizes smaller than 128MiB
authorDmitry Fomichev <dmitry.fomichev@wdc.com>
Tue, 24 Dec 2019 01:05:46 +0000 (17:05 -0800)
committerMike Snitzer <snitzer@redhat.com>
Tue, 7 Jan 2020 16:43:38 +0000 (11:43 -0500)
commitb39962950339912978484cdac50069258545d753
treed4f8a91ea6a6b593edeb88b6a432fd97557463d2
parent43f3952a51f8198d365acb7f51fe42d578fe5d0a
dm zoned: support zone sizes smaller than 128MiB

dm-zoned is observed to log failed kernel assertions and not work
correctly when operating against a device with a zone size smaller
than 128MiB (e.g. 32768 bits per 4K block). The reason is that the
bitmap size per zone is calculated as zero with such a small zone
size. Fix this problem and also make the code related to zone bitmap
management be able to handle per zone bitmaps smaller than a single
block.

A dm-zoned-tools patch is required to properly format dm-zoned devices
with zone sizes smaller than 128MiB.

Fixes: 3b1a94c88b79 ("dm zoned: drive-managed zoned block device target")
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm-zoned-metadata.c