]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
FIX: Cannot exit monitor after takeover
authorAdam Kwolek <adam.kwolek@intel.com>
Thu, 2 Dec 2010 08:18:49 +0000 (09:18 +0100)
committerNeilBrown <neilb@suse.de>
Fri, 3 Dec 2010 03:15:17 +0000 (14:15 +1100)
When performing backward takeover to raid0 monitor cannot exit
for single raid0 array configuration.
Monitor is locked by communication (ping_manager()) after unfreeze()

Do not ping manager for raid0 array as they shouldn't be monitored.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
msg.c

diff --git a/msg.c b/msg.c
index 5ddf6e36fa3fc748f6e904a2ac4f9bb93c8d76fd..5511ecdb75af3b752ebc79aeedadedefc155ad45 100644 (file)
--- a/msg.c
+++ b/msg.c
@@ -381,6 +381,7 @@ void unblock_monitor(char *container, const int unfreeze)
 {
        struct mdstat_ent *ent, *e;
        struct mdinfo *sra = NULL;
+       int to_ping = 0;
 
        ent = mdstat_read(0, 0);
        if (!ent) {
@@ -394,11 +395,14 @@ void unblock_monitor(char *container, const int unfreeze)
                if (!is_container_member(e, container))
                        continue;
                sysfs_free(sra);
-               sra = sysfs_read(-1, e->devnum, GET_VERSION);
+               sra = sysfs_read(-1, e->devnum, GET_VERSION|GET_LEVEL);
+               if (sra->array.level > 0)
+                       to_ping++;
                if (unblock_subarray(sra, unfreeze))
                        fprintf(stderr, Name ": Failed to unfreeze %s\n", e->dev);
        }
-       ping_monitor(container);
+       if (to_ping)
+               ping_monitor(container);
 
        sysfs_free(sra);
        free_mdstat(ent);