summaryrefslogtreecommitdiff
path: root/Monitor.c
diff options
context:
space:
mode:
authorMariusz Tkaczyk <mariusz.tkaczyk@intel.com>2017-09-04 12:52:46 +0200
committerJes Sorensen <jsorensen@fb.com>2017-10-02 15:44:14 -0400
commitb3ab4e4dd78668f58deb87a04eebda62d1090b49 (patch)
treef04a15d55c7db38c049c98beb6543c44ade08b64 /Monitor.c
parentc6839718190d7418aadc858edafb8fb4b67287b0 (diff)
downloadmdadm-b3ab4e4dd78668f58deb87a04eebda62d1090b49.tar.gz
Monitor: Check redundancy for arrays
GET_MISMATCH option doesn't exist for RAID arrays without redundancy so sysfs_read fails if this information is requested. Set options according to the device using information from /proc/mdstat. Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@intel.com> Signed-off-by: Jes Sorensen <jsorensen@fb.com>
Diffstat (limited to 'Monitor.c')
-rw-r--r--Monitor.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Monitor.c b/Monitor.c
index 497e364..b60996b 100644
--- a/Monitor.c
+++ b/Monitor.c
@@ -466,7 +466,7 @@ static int check_array(struct state *st, struct mdstat_ent *mdstat,
int new_array = 0;
int retval;
int is_container = 0;
- unsigned long array_only_flags = 0;
+ unsigned long redundancy_only_flags = 0;
if (test)
alert("TestMessage", dev, NULL, ainfo);
@@ -504,11 +504,11 @@ static int check_array(struct state *st, struct mdstat_ent *mdstat,
if (md_get_array_info(fd, &array) < 0)
goto disappeared;
- if (!is_container)
- array_only_flags |= GET_MISMATCH;
+ if (!is_container && map_name(pers, mse->level) > 0)
+ redundancy_only_flags |= GET_MISMATCH;
sra = sysfs_read(-1, st->devnm, GET_LEVEL | GET_DISKS | GET_DEVS |
- GET_STATE | array_only_flags);
+ GET_STATE | redundancy_only_flags);
if (!sra)
goto disappeared;