From: Chen Cheng Date: Tue, 10 Feb 2026 13:38:47 +0000 (+0800) Subject: md: suppress spurious superblock update error message for dm-raid X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=eff0d74c6c8fd358bc9474c05002e51fa5aa56ad;p=thirdparty%2Fkernel%2Flinux.git md: suppress spurious superblock update error message for dm-raid dm-raid has external metadata management (mddev->external = 1) and no persistent superblock (mddev->persistent = 0). For these arrays, there's no superblock to update, so the error message is spurious. The error appears as: md_update_sb: can't update sb for read-only array md0 Fixes: 8c9e376b9d1a ("md: warn about updating super block failure") Reported-by: Tj Closes: https://lore.kernel.org/all/20260128082430.96788-1-tj.iam.tj@proton.me/ Signed-off-by: Chen Cheng Reviewed-by: Paul Menzel Link: https://lore.kernel.org/linux-raid/20260210133847.269986-1-chencheng@fnnas.com Signed-off-by: Yu Kuai --- diff --git a/drivers/md/md.c b/drivers/md/md.c index 3ce6f9e9d38e..c2cc2302d727 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -2788,7 +2788,9 @@ void md_update_sb(struct mddev *mddev, int force_change) if (!md_is_rdwr(mddev)) { if (force_change) set_bit(MD_SB_CHANGE_DEVS, &mddev->sb_flags); - pr_err("%s: can't update sb for read-only array %s\n", __func__, mdname(mddev)); + if (!mddev_is_dm(mddev)) + pr_err_ratelimited("%s: can't update sb for read-only array %s\n", + __func__, mdname(mddev)); return; }