Skip to contentSkip to conversation

md: Add prompt message about wantreplacement disk in /proc/mdstat

PATCH Applied majianpeng 2 participants 2 messages Feb 28, 2013 – Mar 4, 2013 MD RAID

lore
Share & tools
lore

majianpeng

author
#0 lore raw

PATCH 4/4 md: Add prompt message about wantreplacement disk in /proc/mdstat

From file "/proc/mdstat",we only get the disk which replacing.But we can't get the disk which want repalce.So add the info.

---
 drivers/md/md.c |    2 ++
 1 file changed, 2 insertions(+)
drivers/md/md.c +2 -0
index 3db3d1b..4935dbe 100644
@@ -7017,6 +7017,8 @@ static int md_seq_show(struct seq_file *seq, void *v)
 				seq_printf(seq, "(S)"); /* spare */
 			if (test_bit(Replacement, &rdev->flags))
 				seq_printf(seq, "(R)");
+			if (test_bit(WantReplacement, &rdev->flags))
+				seq_printf(seq, "(WR)");
 			sectors += rdev->sectors;
 		}
 
Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 13 lines · On Thu, 28 Feb 2013 15:50:28 +0800 majianpeng <[email protected]> wrote:

From file "/proc/mdstat",we only get the disk which replacing.But we can't get the disk which want repalce.So add the info.

---
 drivers/md/md.c |    2 ++
 1 file changed, 2 insertions(+)
drivers/md/md.c +0 -0
index 3db3d1b..4935dbe 100644

drivers/md/md.c static int md_seq_show(struct seq_file *seq, void *v) · line 7024

Quoted 8 lines
drivers/md/md.c +2 -0
@@ -7017,6 +7017,8 @@ static int md_seq_show(struct seq_file *seq, void *v)
 				seq_printf(seq, "(S)"); /* spare */
 			if (test_bit(Replacement, &rdev->flags))
 				seq_printf(seq, "(R)");
+			if (test_bit(WantReplacement, &rdev->flags))
+				seq_printf(seq, "(WR)");
 			sectors += rdev->sectors;
 		}
 

If you really need it you can get it from /sys.

not applied.

NeilBrown