Once MD_BROKEN is set on an array, no further writes can be performed.
The user must be informed that the array cannot continue operation.
Add error logging when MD_BROKEN flag is set on raid10 arrays to improve
debugging and system administration visibility.
Signed-off-by: Kenta Akagi <k@mgml.me>
---
drivers/md/raid10.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index aa9d328fe875..369def3413c0 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -2031,6 +2031,10 @@ static void raid10_error(struct mddev *mddev, struct md_rdev *rdev)
if (test_bit(In_sync, &rdev->flags) && !enough(conf, rdev->raid_disk)) {
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)
return;
--
2.50.1