]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Assemble: return correct status from assemble_container_content.
authorNeilBrown <neilb@suse.de>
Fri, 7 Nov 2008 10:39:23 +0000 (21:39 +1100)
committerNeilBrown <neilb@suse.de>
Fri, 7 Nov 2008 10:49:20 +0000 (21:49 +1100)
Otherwise autoassembly can get confused.

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

index 98c9c2b7d2047fe93a5f8f13b75d19076c5f944e..29e3ec7698d7e9c47bf835b65153a9eb4d7d5c26 100644 (file)
@@ -1216,7 +1216,7 @@ int assemble_container_content(struct supertype *st, int mdfd,
                else if (errno == EEXIST)
                        preexist++;
        if (working == 0)
-               /* Nothing new, don't try to start */ ;
+               return 1;/* Nothing new, don't try to start */
        else if (runstop > 0 ||
                 (working + preexist) >= content->array.working_disks) {
 
@@ -1249,15 +1249,16 @@ int assemble_container_content(struct supertype *st, int mdfd,
                        fprintf(stderr, "\n");
                }
                wait_for(chosen_name);
+               return 0;
                /* FIXME should have an O_EXCL and wait for read-auto */
-       } else
+       } else {
                if (verbose >= 0)
                        fprintf(stderr, Name
                                ": %s assembled with %d devices but "
                                "not started\n",
                                chosen_name, working);
-
-       return 0;
+               return 1;
+       }
 }
 #endif