]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
dm table: fix zoned iterate_devices based device capability checks
authorJeffle Xu <jefflexu@linux.alibaba.com>
Tue, 9 Mar 2021 03:27:45 +0000 (11:27 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 11 Mar 2021 12:51:05 +0000 (13:51 +0100)
commit424415d0182ae802bbac261c1845b1486d588084
tree9a57fe26dc1c8c61dcc98ce75d63bf3aaf324741
parenta70a4e8baa0b53b75299f07535e054804365c3fe
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>
[jeffle: also convert no_sg_merge check]
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/md/dm-table.c