]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Manage: sync with mdmon before stopping containers.
authorNeilBrown <neilb@suse.de>
Fri, 18 Jul 2008 06:37:25 +0000 (16:37 +1000)
committerNeilBrown <neilb@suse.de>
Fri, 18 Jul 2008 06:37:25 +0000 (16:37 +1000)
mdmon sometimes opens the container.  That will prevent 'stop'
from working.  So sync with mdmon first.

Signed-off-by: Neil Brown <neilb@suse.de>
Manage.c

index 90031056a0e74d700dbdd3d1e3daa667e394edb1..1a86a859262ce2bc5952d58b188b0406c9f6631d 100644 (file)
--- a/Manage.c
+++ b/Manage.c
@@ -144,6 +144,15 @@ int Manage_runstop(char *devname, int fd, int runstop, int quiet)
                        ping_monitor(mdi->text_version+1);
 
                        fd = open(devname, O_RDONLY);
                        ping_monitor(mdi->text_version+1);
 
                        fd = open(devname, O_RDONLY);
+               } else if (mdi &&
+                          mdi->array.major_version == -1 &&
+                          mdi->array.minor_version == -2 &&
+                          mdi->text_version[0] != '/') {
+                       /* container, possibly mdmon-managed.
+                        * Make sure mdmon isn't opening it, which
+                        * would interfere with the 'stop'
+                        */
+                       ping_monitor(mdi->sys_name);
                }
                if (mdi)
                        sysfs_free(mdi);
                }
                if (mdi)
                        sysfs_free(mdi);