From a714580e029ff92606a10be5db0693f419ce1fec Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Tue, 4 Nov 2008 21:56:42 +1100 Subject: Wait for name to appear after create/assemble etc. We don't really want mdadm to exit until udev has created the names in /dev. So wait. Signed-off-by: NeilBrown --- Assemble.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'Assemble.c') diff --git a/Assemble.c b/Assemble.c index 0aff1be..c86a165 100644 --- a/Assemble.c +++ b/Assemble.c @@ -1216,6 +1216,10 @@ int assemble_container_content(struct supertype *st, int mdfd, /* Nothing new, don't try to start */ ; else if (runstop > 0 || (working + preexist) >= content->array.working_disks) { + + map_update(&map, fd2devnum(mdfd), + content->text_version, + content->uuid, chosen_name); switch(content->array.level) { case LEVEL_LINEAR: case LEVEL_MULTIPATH: @@ -1241,6 +1245,7 @@ int assemble_container_content(struct supertype *st, int mdfd, fprintf(stderr, " (%d new)", working); fprintf(stderr, "\n"); } + wait_for(chosen_name); /* FIXME should have an O_EXCL and wait for read-auto */ } else if (verbose >= 0) @@ -1248,9 +1253,6 @@ int assemble_container_content(struct supertype *st, int mdfd, ": %s assembled with %d devices but " "not started\n", chosen_name, working); - map_update(&map, fd2devnum(mdfd), - content->text_version, - content->uuid, chosen_name); return 0; } -- cgit