From: Yu Kuai Date: Wed, 14 Jan 2026 17:12:29 +0000 (+0800) Subject: md/raid5: fix raid5_run() to return error when log_init() fails X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2d9f7150ac197ce79c9c917a004d4cf0b26ad7e0;p=thirdparty%2Fkernel%2Flinux.git md/raid5: fix raid5_run() to return error when log_init() fails Since commit f63f17350e53 ("md/raid5: use the atomic queue limit update APIs"), the abort path in raid5_run() returns 'ret' instead of -EIO. However, if log_init() fails, 'ret' is still 0 from the previous successful call, causing raid5_run() to return success despite the failure. Fix this by capturing the return value from log_init(). Link: https://lore.kernel.org/linux-raid/20260114171241.3043364-2-yukuai@fnnas.com Fixes: f63f17350e53 ("md/raid5: use the atomic queue limit update APIs") Reported-by: Dan Carpenter Closes: https://lore.kernel.org/r/202601130531.LGfcZsa4-lkp@intel.com/ Signed-off-by: Yu Kuai Reviewed-by: Li Nan Reviewed-by: Xiao Ni Reviewed-by: Christoph Hellwig --- diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 8dc98f545969f..a85878b009f9a 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c @@ -8057,7 +8057,8 @@ static int raid5_run(struct mddev *mddev) goto abort; } - if (log_init(conf, journal_dev, raid5_has_ppl(conf))) + ret = log_init(conf, journal_dev, raid5_has_ppl(conf)); + if (ret) goto abort; return 0;