Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753931AbdCTJwS (ORCPT ); Mon, 20 Mar 2017 05:52:18 -0400 Received: from mail-wm0-f42.google.com ([74.125.82.42]:37301 "EHLO mail-wm0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753322AbdCTJwQ (ORCPT ); Mon, 20 Mar 2017 05:52:16 -0400 From: Gioh Kim To: jes.sorensen@gmail.com Cc: neilb@suse.com, linux-raid@vger.kernel.org, linux-kernel@vger.kernel.org, Jack Wang Subject: [PATCHv2 2/2] super1: check and output faulty dev role Date: Mon, 20 Mar 2017 10:51:57 +0100 Message-Id: <1490003517-4216-3-git-send-email-gi-oh.kim@profitbricks.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1490003517-4216-1-git-send-email-gi-oh.kim@profitbricks.com> References: <1490003517-4216-1-git-send-email-gi-oh.kim@profitbricks.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 867 Lines: 30 From: Jack Wang Output the real dev role in examine_super1, it will help to find problem. Signed-off-by: Jack Wang Reviewed-by: Gioh Kim --- 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