[Devel] [PATCH hci-8.1] dm: don't inherit bio-based table type for targets without ->map
no-reply at sashiko.virtuozzo.com
no-reply at sashiko.virtuozzo.com
Sat Oct 17 12:38:31 MSK 2026
> A table whose single target has no devices inherits the live table's
> type in dm_table_determine_type(). dm-qcow2 and dm-ploop open their
> images by fd and never call dm_get_device(), so loading them over a
> bio-based live table makes the table bio-based although these targets
> have no ->map. The first bio then calls a NULL ->map from __map_bio():
>
> BUG: kernel NULL pointer dereference, address: 0000000000000000
> RIP: 0010:0x0
> __map_bio+0x197/0x1c0 [dm_mod]
> dm_split_and_process_bio+0x1ad/0x740 [dm_mod]
>
> Inherit the live table's type only if the target has ->map, so it can
> run bio-based. Otherwise keep the request-based type, so table_load()
> rejects the mismatch with "can't change device type".
>
> https://virtuozzo.atlassian.net/browse/VSTOR-150573
> Signed-off-by: Alexander Ivanov <alexander.ivanov at virtuozzo.com>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261017093503.771224-1-alexander.ivanov@virtuozzo.com?part=1
More information about the Devel
mailing list