linux-stable/include
Shin'ichiro Kawasaki 2d669ceb69 dm table: Fix zoned model check and zone sectors check
Commit 24f6b6036c ("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: 24f6b6036c ("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>
2021-03-22 12:32:31 -04:00
..
acpi
asm-generic RISC-V Patches for the 5.12 Merge Window 2021-02-26 10:28:35 -08:00
clocksource
crypto Keyrings miscellany 2021-02-23 16:09:23 -08:00
drm drm/ttm: make ttm_bo_unpin more defensive 2021-03-15 16:02:30 +01:00
dt-bindings RISC-V Patches for the 5.12 Merge Window 2021-02-26 10:28:35 -08:00
keys
kunit
kvm KVM: arm64: Turn kvm_arm_support_pmu_v3() into a static key 2021-03-06 04:18:40 -05:00
linux dm table: Fix zoned model check and zone sectors check 2021-03-22 12:32:31 -04:00
math-emu
media media: rc: compile rc-cec.c into rc-core 2021-03-11 11:40:28 +01:00
memory
misc
net net: icmp: pass zeroed opts from icmp{,v6}_ndo_send before sending 2021-02-23 11:29:52 -08:00
pcmcia
ras
rdma
scsi
soc RISC-V Patches for the 5.12 Merge Window 2021-02-26 10:28:35 -08:00
sound ALSA/ASoC/SOF/SoundWire: fix Kconfig issues 2021-03-02 18:30:07 +01:00
target scsi: target: core: Add cmd length set before cmd complete 2021-02-22 22:21:29 -05:00
trace workqueue/tracing: Copy workqueue name to buffer in trace event 2021-03-18 12:57:37 -04:00
uapi fuse fixes for 5.12-rc4 2021-03-16 10:29:45 -07:00
vdso
video
xen Xen/gnttab: introduce common INVALID_GRANT_{HANDLE,REF} 2021-03-10 16:39:29 -06:00