Create: don't wait for device to appear if we didn't actually start the array
authorNeilBrown <neilb@suse.de>
Fri, 7 Nov 2008 11:20:56 +0000 (22:20 +1100)
committerNeilBrown <neilb@suse.de>
Fri, 7 Nov 2008 11:20:56 +0000 (22:20 +1100)
Otherwise we get an unpleasant 2 second pause when array creation
fails.

Signed-off-by: NeilBrown <neilb@suse.de>
Create.c

index da05eed..783ab09 100644 (file)
--- a/Create.c
+++ b/Create.c
@@ -780,11 +780,11 @@ int Create(struct supertype *st, char *mddev,
                        ping_monitor(devnum2devname(st->container_dev));
                        close(container_fd);
                }
+               wait_for(chosen_name);
        } else {
                fprintf(stderr, Name ": not starting array - not enough devices.\n");
        }
        close(mdfd);
-       wait_for(chosen_name);
        return 0;
 
  abort: