]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
mdmon: Stop keeping track of RAID0 (and LINEAR) arrays.
authorNeilBrown <neilb@suse.de>
Tue, 22 Mar 2011 06:23:17 +0000 (17:23 +1100)
committerNeilBrown <neilb@suse.de>
Tue, 22 Mar 2011 06:23:17 +0000 (17:23 +1100)
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>
managemon.c
monitor.c

index a2816cebd3062468243d0209efecaf88ad1ac682..67c59514b0e77bce3bba41051802bd0bdc28e685 100644 (file)
@@ -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,
index 69026ca0e35cc6d753b79c92e92d16e3255494a1..4a34bc1d8fdae282067b247eb1497195b8013c13 100644 (file)
--- a/monitor.c
+++ b/monitor.c
@@ -535,7 +535,7 @@ static int wait_and_act(struct supertype *container, int nowait)
                /* once an array has been deactivated we want to
                 * ask the manager to discard it.
                 */
-               if (!a->container || (a->info.array.level == 0)) {
+               if (!a->container) {
                        if (discard_this) {
                                ap = &(*ap)->next;
                                continue;