diff options
author | Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com> | 2021-03-16 13:36:02 +0900 |
---|---|---|
committer | Mike Snitzer <snitzer@redhat.com> | 2021-03-22 12:32:31 -0400 |
commit | 2d669ceb69c276f7637cf760287ca4187add082e (patch) | |
tree | 9afb6ca9998067b5293d189b8ed98f16bd437def /drivers/nfc/microread/i2c.c | |
parent | 160f99db943224e55906dd83880da1a704c6e6b9 (diff) |
dm table: Fix zoned model check and zone sectors check
Commit 24f6b6036c9e ("dm table: fix zoned iterate_devices based device
capability checks") triggered dm table load failure when dm-zoned device
is set up for zoned block devices and a regular device for cache.
The commit inverted logic of two callback functions for iterate_devices:
device_is_zoned_model() and device_matches_zone_sectors(). The logic of
device_is_zoned_model() was inverted then all destination devices of all
targets in dm table are required to have the expected zoned model. This
is fine for dm-linear, dm-flakey and dm-crypt on zoned block devices
since each target has only one destination device. However, this results
in failure for dm-zoned with regular cache device since that target has
both regular block device and zoned block devices.
As for device_matches_zone_sectors(), the commit inverted the logic to
require all zoned block devices in each target have the specified
zone_sectors. This check also fails for regular block device which does
not have zones.
To avoid the check failures, fix the zone model check and the zone
sectors check. For zone model check, introduce the new feature flag
DM_TARGET_MIXED_ZONED_MODEL, and set it to dm-zoned target. When the
target has this flag, allow it to have destination devices with any
zoned model. For zone sectors check, skip the check if the destination
device is not a zoned block device. Also add comments and improve an
error message to clarify expectations to the two checks.
Fixes: 24f6b6036c9e ("dm table: fix zoned iterate_devices based device capability checks")
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'drivers/nfc/microread/i2c.c')
0 files changed, 0 insertions, 0 deletions