summaryrefslogtreecommitdiff
path: root/mdstat.c
diff options
context:
space:
mode:
authorLidong Zhong <lidong.zhong@suse.com>2020-04-14 16:19:41 +0800
committerJes Sorensen <jsorensen@fb.com>2020-04-27 10:33:46 -0400
commit1c294b5d960abeeb9e0f188af294d019bc82b20e (patch)
treea8fe1b3be381d173d5eecef13cac5ea8ec7f6ed1 /mdstat.c
parent185ec4397e61ad00dd68c841e15eaa8629eb9514 (diff)
downloadmdadm-1c294b5d960abeeb9e0f188af294d019bc82b20e.tar.gz
Detail: adding sync status for cluster device
On the node with /proc/mdstat is Personalities : [raid1] md0 : active raid1 sdb[4] sdc[3] sdd[2] 1046528 blocks super 1.2 [3/2] [UU_] recover=REMOTE bitmap: 1/1 pages [4KB], 65536KB chunk Let's change the 'State' of 'mdadm -Q -D' accordingly State : clean, degraded With this patch, it will be State : clean, degraded, recovering (REMOTE) Signed-off-by: Lidong Zhong <lidong.zhong@suse.com> Acked-by: Guoqing Jiang <guoqing.jiang@cloud.ionos.com> Signed-off-by: Jes Sorensen <jsorensen@fb.com>
Diffstat (limited to 'mdstat.c')
-rw-r--r--mdstat.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/mdstat.c b/mdstat.c
index 7e600d0..20577a3 100644
--- a/mdstat.c
+++ b/mdstat.c
@@ -257,6 +257,8 @@ struct mdstat_ent *mdstat_read(int hold, int start)
ent->percent = RESYNC_DELAYED;
if (l > 8 && strcmp(w+l-8, "=PENDING") == 0)
ent->percent = RESYNC_PENDING;
+ if (l > 7 && strcmp(w+l-7, "=REMOTE") == 0)
+ ent->percent = RESYNC_REMOTE;
} else if (ent->percent == RESYNC_NONE &&
w[0] >= '0' &&
w[0] <= '9' &&