Skip to contentSkip to conversation

md: suppress spurious superblock update error message for dm-raid

PATCH In review Chen Cheng 2 participants 2 messages Feb 10 – Feb 26 MD RAID

lore
Share & tools
lore

Chen Cheng

author
#0 lore raw

PATCH 1/1 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:

[  123.456789] md_update_sb: can't update sb for read-only array md0
Fixes 6a5cb53aaa1d ("md: don't ignore read-only array in md_update_sb()")
---
 drivers/md/md.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/md/md.c +3 -1
index 6d73f6e196a..e30b658641e 100644
@@ -2790,7 +2790,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;
 	}
 
Signature · 1 line
2.51.0
Reviewed-by Paul Menzel on v1 1/1
#1 lore raw

Hi,

Quoted 11 lines · Chen Cheng

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:

[  123.456789] md_update_sb: can't update sb for read-only array md0
Fixes 6a5cb53aaa1d ("md: don't ignore read-only array in md_update_sb()")

The Link and Fixes tag is incorrect, applied with following commit message:

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

Quoted 19 lines
---
  drivers/md/md.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)
drivers/md/md.c +3 -1
index 6d73f6e196a..e30b658641e 100644
@@ -2790,7 +2790,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;
  	}
 
Signature · 2 lines
Thansk,
Kuai