Skip to content

Commit eff0d74

Browse files
chencheng-fnnashailan94
authored andcommitted
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: 8c9e376 ("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>
1 parent 5d54016 commit eff0d74

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

drivers/md/md.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2788,7 +2788,9 @@ void md_update_sb(struct mddev *mddev, int force_change)
27882788
if (!md_is_rdwr(mddev)) {
27892789
if (force_change)
27902790
set_bit(MD_SB_CHANGE_DEVS, &mddev->sb_flags);
2791-
pr_err("%s: can't update sb for read-only array %s\n", __func__, mdname(mddev));
2791+
if (!mddev_is_dm(mddev))
2792+
pr_err_ratelimited("%s: can't update sb for read-only array %s\n",
2793+
__func__, mdname(mddev));
27922794
return;
27932795
}
27942796

0 commit comments

Comments
 (0)