dm zoned: check zone capacity
authorDamien Le Moal <damien.lemoal@wdc.com>
Wed, 19 May 2021 01:26:16 +0000 (10:26 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 19 Jul 2021 07:45:01 +0000 (09:45 +0200)
commitcbc03ffec260c28cd177fee143f2fe74cc36ba00
tree940bcc2f822df57890150214fce04904b7f52c67
parent35c1c4bd2d59ad734129d4e232af9d1098023918
dm zoned: check zone capacity

commit bab68499428ed934f0493ac74197ed6f36204260 upstream.

The dm-zoned target cannot support zoned block devices with zones that
have a capacity smaller than the zone size (e.g. NVMe zoned namespaces)
due to the current chunk zone mapping implementation as it is assumed
that zones and chunks have the same size with all blocks usable.
If a zoned drive is found to have zones with a capacity different from
the zone size, fail the target initialization.

Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Cc: stable@vger.kernel.org # v5.9+
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/md/dm-zoned-metadata.c