]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Grow: Only ping monitor on level change if array is container based.
authorNeilBrown <neilb@suse.de>
Mon, 17 Oct 2011 05:51:31 +0000 (16:51 +1100)
committerNeilBrown <neilb@suse.de>
Mon, 17 Oct 2011 05:51:31 +0000 (16:51 +1100)
Pinging the monitor for a NULL container is bad.

Reported-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
Tested-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
Signed-off-by: NeilBrown <neilb@suse.de>
Grow.c

diff --git a/Grow.c b/Grow.c
index 4f8b9d74ca0898607c9f996a1e67e0999179ee82..0e4dd108aa9617f35111503c68aa94641a655996 100644 (file)
--- a/Grow.c
+++ b/Grow.c
@@ -1648,8 +1648,12 @@ int Grow_reshape(char *devname, int fd, int quiet, char *backup_file,
                        rv = 1;
                        goto release;
                }
-               /* FIXME this is added with no justification - why is it here */
-               ping_monitor(container);
+               /* Make sure mdmon has seen the device removal
+                * and updated metadata before we continue with
+                * level change
+                */
+               if (container)
+                       ping_monitor(container);
        }
 
        memset(&info, 0, sizeof(info));