File 0118-IncrementalScan-Use-md_array_active-instead-of-md_ge.patch of Package mdadm.14070
From 00e56fd9537e1f69583d8b0f60faf02026f24d1b Mon Sep 17 00:00:00 2001
From: Jes Sorensen <jsorensen@fb.com>
Date: Fri, 5 May 2017 12:18:29 -0400
Subject: [PATCH] IncrementalScan: Use md_array_active() instead of
md_get_array_info()
Git-commit: 00e56fd9537e1f69583d8b0f60faf02026f24d1b
Patch-mainline: mdadm-4.0+
References: bsc#1069165, bsc#1069167, bsc#1068030
This eliminates yet another case where GET_ARRAY_INFO was used to
indicate whether the array was active.
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
Signed-off-by: Coly Li <colyli@suse.de>
---
Incremental.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/Incremental.c b/Incremental.c
index b73eabd..680d318 100644
--- a/Incremental.c
+++ b/Incremental.c
@@ -1317,7 +1317,6 @@ int IncrementalScan(struct context *c, char *devnm)
restart:
for (me = mapl ; me ; me = me->next) {
- mdu_array_info_t array;
struct mdinfo *sra;
int mdfd;
@@ -1362,7 +1361,7 @@ restart:
rv = 1;
continue;
}
- if (md_get_array_info(mdfd, &array) == 0 || errno != ENODEV) {
+ if (md_array_active(mdfd)) {
close(mdfd);
continue;
}
--
2.13.6