diff options
author | NeilBrown <neilb@suse.de> | 2011-03-22 07:23:17 +0100 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2011-03-22 07:23:17 +0100 |
commit | 7023e0b8aed8807b0c394f61a3c4ac937dbd6b86 (patch) | |
tree | 47ecc097ffa00c697833f839243279dc2043f22f /managemon.c | |
parent | mdmon: don't wait for O_EXCL when shutting down. (diff) | |
download | mdadm-7023e0b8aed8807b0c394f61a3c4ac937dbd6b86.tar.xz mdadm-7023e0b8aed8807b0c394f61a3c4ac937dbd6b86.zip |
mdmon: Stop keeping track of RAID0 (and LINEAR) arrays.
Tracking RAID0 arrays doesn't really work. There is no need,
and there are some sysfs files which won't exist when the array
appears and then won't be opened when the level is changed.
So simply ignore RAID0 and LINEAR arrays - don't add them when they
appear and if an array we are monitoring turns into one of these,
discard it promptly.
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'managemon.c')
-rw-r--r-- | managemon.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/managemon.c b/managemon.c index a2816ceb..67c59514 100644 --- a/managemon.c +++ b/managemon.c @@ -460,7 +460,11 @@ static void manage_member(struct mdstat_ent *mdstat, if (mdstat->level) { int level = map_name(pers, mdstat->level); - if (a->info.array.level != level && level >= 0) { + if (level == 0 || level == LEVEL_LINEAR) { + a->container = NULL; + return; + } + else if (a->info.array.level != level && level > 0) { struct active_array *newa = duplicate_aa(a); if (newa) { newa->info.array.level = level; @@ -608,7 +612,10 @@ static void manage_new(struct mdstat_ent *mdstat, char buf[40]; /* check if array is ready to be monitored */ - if (!mdstat->active) + if (!mdstat->active || !mdstat->level) + return; + if (strcmp(mdstat->level, "raid0") == 0 || + strcmp(mdstat->level, "linear") == 0) return; mdi = sysfs_read(-1, mdstat->devnum, |