dm table: fix zoned iterate_devices based device capability checks
authorJeffle Xu <jefflexu@linux.alibaba.com>
Tue, 9 Feb 2021 03:46:38 +0000 (22:46 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 4 Mar 2021 10:38:44 +0000 (11:38 +0100)
commit72d17fa4ed116500857ae23a5c352195a9b94555
treebd04d23802fab7e3f4d329798fa2b291ed459687
parentbc3f609db369f126631aa0bc2be7e9a4727a1836
dm table: fix zoned iterate_devices based device capability checks

commit 24f6b6036c9eec21191646930ad42808e6180510 upstream.

Fix dm_table_supports_zoned_model() and invert logic of both
iterate_devices_callout_fn so that all devices' zoned capabilities are
properly checked.

Add one more parameter to dm_table_any_dev_attr(), which is actually
used as the @data parameter of iterate_devices_callout_fn, so that
dm_table_matches_zone_sectors() can be replaced by
dm_table_any_dev_attr().

Fixes: dd88d313bef02 ("dm table: add zoned block devices validation")
Cc: stable@vger.kernel.org
Signed-off-by: Jeffle Xu <jefflexu@linux.alibaba.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/md/dm-table.c