From 9cfaac58eab7625d818496504555fa70dbd5d8ac Mon Sep 17 00:00:00 2001 From: Eduard Shishkin Date: Wed, 20 Sep 2023 13:18:55 +0200 Subject: [PATCH] zipl_helper.device-mapper: fix bug in get_physical_device() Fix mistake in @fs_offset calculation. Since any logical dm-device can be built of partitions, @fs_offset must not decrease while ascending the "device tree" during the procedure of dm-device resolution (which always starts at the formatted logical device, for which @fs_offset is 0). This bug was not reproducible earlier because of restricted functionality in a combination with side-effects. The fixup is required however by the next patches in the series implementing support of mirrored targets by zipl tool Signed-off-by: Eduard Shishkin Reviewed-by: Stefan Haberland Signed-off-by: Steffen Eiden --- zipl/src/zipl_helper.device-mapper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zipl/src/zipl_helper.device-mapper.c b/zipl/src/zipl_helper.device-mapper.c index 3a44735f..91308cef 100644 --- a/zipl/src/zipl_helper.device-mapper.c +++ b/zipl/src/zipl_helper.device-mapper.c @@ -860,7 +860,7 @@ static int get_physical_device(struct physical_device *pd, dev_t dev, target_entry_new(makedev(major, minor), target)); table_free(table); /* Convert fs_start to offset on parent target */ - start -= target->start; + start += target->start; } }