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: 8c9e376b9d ("md: warn about updating super block failure")
Reported-by: Tj <tj.iam.tj@proton.me>
Closes: https://lore.kernel.org/all/20260128082430.96788-1-tj.iam.tj@proton.me/
Signed-off-by: Chen Cheng <chencheng@fnnas.com>
Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>
Link: https://lore.kernel.org/linux-raid/20260210133847.269986-1-chencheng@fnnas.com
Signed-off-by: Yu Kuai <yukuai@fnnas.com>
This commit is contained in:
Chen Cheng
2026-02-10 21:38:47 +08:00
committed by Yu Kuai
parent 5d54016205
commit eff0d74c6c

View File

@@ -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;
}