]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
dm clone: drop redundant size checks
authorLi Chen <me@linux.beauty>
Wed, 10 Dec 2025 03:17:57 +0000 (11:17 +0800)
committerMikulas Patocka <mpatocka@redhat.com>
Sun, 4 Jan 2026 19:35:32 +0000 (20:35 +0100)
commita23cc8257ecdfdeb25fd26d25fec4539ef377944
treea4fa5b69cf320031418565965261658e88d808c7
parenta2f0a98b13db005403d026274782ac668b59df32
dm clone: drop redundant size checks

The clone target already exposes both source and destination devices via
clone_iterate_devices(), so dm-table's device_area_is_invalid() helper
ensures that the mapping does not extend past either underlying block
device.

The manual comparisons between ti->len and the source/destination device
sizes in parse_source_dev() and parse_dest_dev() are therefore
redundant. Remove these checks and rely on the core validation instead.
This changes the error strings reported when the devices are too small,
but preserves the failure behaviour.

Signed-off-by: Li Chen <me@linux.beauty>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
drivers/md/dm-clone-target.c