Skip to contentSkip to conversation

md: suppress spurious superblock update warning for dm-raid

PATCH In review chencheng 2 participants 2 messages Feb 10 MD RAID

lore
Share & tools
lore

chencheng

author
#0 lore raw

PATCH 1/1 md: suppress spurious superblock update warning for dm-raid

dm-raid have external metadata management (mddev->external = 1) and no persistent superblock (mddev->persistent = 0). For these arrays, there's no superblock to update, so the warning is spurious.

---
 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 on v1 1/1
#1 lore raw

Dear Chen,

Thank you for your patch.

Am 10.02.26 um 13:41 schrieb chencheng:

Quoted 3 lines

dm-raid have external metadata management (mddev->external = 1) and no persistent superblock (mddev->persistent = 0). For these arrays, there's no superblock to update, so the warning is spurious.

Please paste the warning.

Please also add a Fixes: tag.

Quoted 1 line

Would Chen Cheng be the official (transcribed) spelling of your name. If you yes, it’d be great, if you updated it:

    git config --global user.name "Chen Cheng"
    git commit --amend -s --author="Chen Cheng <[email protected]>"
Quoted 9 lines
---
  drivers/md/md.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)
drivers/md/md.c +0 -0
index 6d73f6e196a..e30b658641e 100644

drivers/md/md.c void md_update_sb(struct mddev *mddev, int force_change) · line 2795

Quoted 7 lines
drivers/md/md.c +3 -1
@@ -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));

(It looks like it’s an error level message and not a warning level message.)

drivers/md/md.c void md_update_sb(struct mddev *mddev, int force_change) · line 2797

Quoted 2 lines
drivers/md/md.c +0 -0
  		return;
  	}

With the commit message suggestions addressed, feel free to add:

Kind regards,

Paul