Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1604315

[PATCHv2 2/2] super1: check and output faulty dev role

From Gioh Kim <gi-oh.kim@profitbricks.com>
Newsgroups linux.kernel
Subject [PATCHv2 2/2] super1: check and output faulty dev role
Date 2017-03-20 11:00 +0100
Message-ID <tn2gA-2R9-59@gated-at.bofh.it> (permalink)
References <tn2gy-2R9-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Jack Wang <jinpu.wang@profitbricks.com>

Output the real dev role in examine_super1, it will help to
find problem.

Signed-off-by: Jack Wang <jinpu.wang@profitbricks.com>
Reviewed-by: Gioh Kim <gi-oh.kim@profitbricks.com>
---
 super1.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/super1.c b/super1.c
index f3520ac..c903371 100644
--- a/super1.c
+++ b/super1.c
@@ -501,8 +501,10 @@ static void examine_super1(struct supertype *st, char *homehost)
 #endif
 	printf("   Device Role : ");
 	role = role_from_sb(sb);
-	if (role >= MD_DISK_ROLE_FAULTY)
-		printf("spare\n");
+	if (role == MD_DISK_ROLE_SPARE)
+		printf("Spare\n");
+	else if (role == MD_DISK_ROLE_FAULTY)
+		printf("Faulty\n");
 	else if (role == MD_DISK_ROLE_JOURNAL)
 		printf("Journal\n");
 	else if (sb->feature_map & __cpu_to_le32(MD_FEATURE_REPLACEMENT))
-- 
2.5.0

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCHv2 0/2] mdadm: setting device role of raid1 disk with failfast Gioh Kim <gi-oh.kim@profitbricks.com> - 2017-03-20 11:00 +0100
  [PATCHv2 1/2] super1: ignore failfast flag for setting device role Gioh Kim <gi-oh.kim@profitbricks.com> - 2017-03-20 11:00 +0100
  [PATCHv2 2/2] super1: check and output faulty dev role Gioh Kim <gi-oh.kim@profitbricks.com> - 2017-03-20 11:00 +0100
    Re: [PATCHv2 2/2] super1: check and output faulty dev role NeilBrown <neilb@suse.com> - 2017-03-21 21:50 +0100
      Re: [PATCHv2 2/2] super1: check and output faulty dev role Jinpu Wang <jinpu.wang@profitbricks.com> - 2017-03-22 11:30 +0100
  Re: [PATCHv2 0/2] mdadm: setting device role of raid1 disk with  failfast Gioh Kim <gi-oh.kim@profitbricks.com> - 2017-03-27 13:10 +0200

csiph-web