From: dongshengyuan <545258830@qq.com> Date: Tue, 16 Jun 2026 01:07:25 +0000 (+0800) Subject: gpt-auto-generator: fix error propagation in add_root_mount() X-Git-Tag: v261-rc4~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f50ac21cebb76fbc897e4b04a3d4acbf3773b1d5;p=thirdparty%2Fsystemd.git gpt-auto-generator: fix error propagation in add_root_mount() When generator_write_initrd_root_device_deps() fails, the error was swallowed by returning 0 (success) instead of r. The two subsequent calls in the same block correctly return r on failure. Signed-off-by: dongshengyuan Co-developed-by: Claude Opus 4.8 (1M context) --- diff --git a/src/gpt-auto-generator/gpt-auto-generator.c b/src/gpt-auto-generator/gpt-auto-generator.c index abbb955e599..b92ac8f66a7 100644 --- a/src/gpt-auto-generator/gpt-auto-generator.c +++ b/src/gpt-auto-generator/gpt-auto-generator.c @@ -882,7 +882,7 @@ static int add_root_mount(void) { if (in_initrd()) { r = generator_write_initrd_root_device_deps(arg_dest_late, bdev); if (r < 0) - return 0; + return r; r = add_root_cryptsetup(); if (r < 0)