[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250828163216.4225-3-k@mgml.me>
Date: Fri, 29 Aug 2025 01:32:15 +0900
From: Kenta Akagi <k@...l.me>
To: Song Liu <song@...nel.org>, Yu Kuai <yukuai3@...wei.com>,
Mariusz Tkaczyk <mtkaczyk@...nel.org>,
Guoqing Jiang <jgq516@...il.com>
Cc: linux-raid@...r.kernel.org, linux-kernel@...r.kernel.org,
Kenta Akagi <k@...l.me>
Subject: [PATCH v3 2/3] md/raid1,raid10: Add error message when setting MD_BROKEN
Once MD_BROKEN is set on an array, no further writes can be
performed to it.
The user must be informed that the array cannot continue operation.
Signed-off-by: Kenta Akagi <k@...l.me>
---
drivers/md/raid1.c | 5 +++++
drivers/md/raid10.c | 5 +++++
2 files changed, 10 insertions(+)
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index 8a61fd93b3ff..547635bcfdb9 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -1770,7 +1770,12 @@ static void raid1_error(struct mddev *mddev, struct md_rdev *rdev)
mdname(mddev), rdev->bdev);
return;
}
+
set_bit(MD_BROKEN, &mddev->flags);
+ pr_crit("md/raid1:%s: Disk failure on %pg, this is the last device.\n"
+ "md/raid1:%s: Cannot continue operation (%d/%d failed).\n",
+ mdname(mddev), rdev->bdev,
+ mdname(mddev), mddev->degraded + 1, conf->raid_disks);
if (!mddev->fail_last_dev) {
conf->recovery_disabled = mddev->recovery_disabled;
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index 530ad6503189..b940ab4f6618 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -2018,7 +2018,12 @@ static void raid10_error(struct mddev *mddev, struct md_rdev *rdev)
mdname(mddev), rdev->bdev);
return;
}
+
set_bit(MD_BROKEN, &mddev->flags);
+ pr_crit("md/raid10:%s: Disk failure on %pg, this is the last device.\n"
+ "md/raid10:%s: Cannot continue operation (%d/%d failed).\n",
+ mdname(mddev), rdev->bdev,
+ mdname(mddev), mddev->degraded + 1, conf->geo.raid_disks);
if (!mddev->fail_last_dev) {
spin_unlock_irqrestore(&conf->device_lock, flags);
--
2.50.1
Powered by blists - more mailing lists