Skip to contentSkip to conversation

md: identify array and device in metadata write errors

PATCH In review Chen Cheng 1 participant 3 messages Nov 28 MD RAID

lore
Share & tools
lore

Chen Cheng

author
#0 lore raw

PATCH 1/1 md: identify array and device in metadata write errors

The error log in super_written() does not show which array or device failed. Add both names to help locate the failed write.

---
 drivers/md/md.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/md/md.c +2 -1
index 03e35386a802..5c4c721dbba4 100644
@@ -1107,11 +1107,12 @@ static void super_written(struct bio *bio)
 {
 	struct md_rdev *rdev = bio->bi_private;
 	struct mddev *mddev = rdev->mddev;
 
 	if (bio->bi_status) {
-		pr_err("md: %s gets error=%d\n", __func__,
+		pr_err("md: %s: %pg: %s gets error=%d\n",
+		       mdname(mddev), bio->bi_bdev, __func__,
 		       blk_status_to_errno(bio->bi_status));
 		md_error(mddev, rdev);
 		if (!test_bit(Faulty, &rdev->flags)
 		    && (bio->bi_opf & MD_FAILFAST)) {
 			set_bit(MD_SB_NEED_REWRITE, &mddev->sb_flags);
Signature · 1 line
2.56.0
author
#1 lore raw

Ignore this one please, a apologize for noise because misuse my deprecated e-mail address, thanks.

Quoted 26 lines · Chen Cheng

The error log in super_written() does not show which array or device failed. Add both names to help locate the failed write.

---
  drivers/md/md.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
drivers/md/md.c +2 -1
index 03e35386a802..5c4c721dbba4 100644
@@ -1107,11 +1107,12 @@ static void super_written(struct bio *bio)
  {
  	struct md_rdev *rdev = bio->bi_private;
  	struct mddev *mddev = rdev->mddev;
 
  	if (bio->bi_status) {
-		pr_err("md: %s gets error=%d\n", __func__,
+		pr_err("md: %s: %pg: %s gets error=%d\n",
+		       mdname(mddev), bio->bi_bdev, __func__,
  		       blk_status_to_errno(bio->bi_status));
  		md_error(mddev, rdev);
  		if (!test_bit(Faulty, &rdev->flags)
  		    && (bio->bi_opf & MD_FAILFAST)) {
  			set_bit(MD_SB_NEED_REWRITE, &mddev->sb_flags);
author
#2 lore raw

[email protected] is correct. Please use this submission and disregard the earlier one sent from [email protected]. Sorry for the duplicate.

Quoted 30 lines · Chen Cheng

Ignore this one please, a apologize for noise because misuse my deprecated e-mail address, thanks.

Quoted 26 lines · Chen Cheng

The error log in super_written() does not show which array or device failed. Add both names to help locate the failed write.

---
   drivers/md/md.c | 3 ++-
   1 file changed, 2 insertions(+), 1 deletion(-)
drivers/md/md.c +2 -1
index 03e35386a802..5c4c721dbba4 100644
@@ -1107,11 +1107,12 @@ static void super_written(struct bio *bio)
   {
   	struct md_rdev *rdev = bio->bi_private;
   	struct mddev *mddev = rdev->mddev;
 
   	if (bio->bi_status) {
-		pr_err("md: %s gets error=%d\n", __func__,
+		pr_err("md: %s: %pg: %s gets error=%d\n",
+		       mdname(mddev), bio->bi_bdev, __func__,
   		       blk_status_to_errno(bio->bi_status));
   		md_error(mddev, rdev);
   		if (!test_bit(Faulty, &rdev->flags)
   		    && (bio->bi_opf & MD_FAILFAST)) {
   			set_bit(MD_SB_NEED_REWRITE, &mddev->sb_flags);