mdmon sometimes opens the container. That will prevent 'stop'
from working. So sync with mdmon first.
Signed-off-by: Neil Brown <neilb@suse.de>
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);