]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Assemble: simplify the handling of is_member_busy.
authorNeilBrown <neilb@suse.de>
Mon, 22 Nov 2010 09:58:06 +0000 (20:58 +1100)
committerNeilBrown <neilb@suse.de>
Mon, 22 Nov 2010 09:58:06 +0000 (20:58 +1100)
This is somewhat inconsistent with the last member of a
container getting special handling.
Just simplify it so the code seems to make sense and important
is easy to follow.

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

index fce8d344e3132591ac284e9ea8ce7b3cc061a6aa..771cb77c88ccd5493ec3b094f2bae438be4324c8 100644 (file)
@@ -420,26 +420,14 @@ int Assemble(struct supertype *st, char *mddev,
                                           report_missmatch ? devname : NULL)) {
                                content = content->next;
                                goto next_member;
-                       }
-
-                       /* we have the one container we need, don't keep
-                        * looking.  If the chosen member is active, skip.
-                        */
-                       if (is_member_busy(content->text_version)) {
+                       } else if (is_member_busy(content->text_version)) {
                                if (report_missmatch)
                                        fprintf(stderr, Name ": member %s in %s is already assembled\n",
                                                content->text_version,
                                                devname);
 
                                content = content->next;
-                               if (content)
-                                       goto next_member;
-                               tst->ss->free_super(tst);
-                               tst = NULL;
-                               if (auto_assem)
-                                       goto loop;
-                               dev_policy_free(pol);
-                               return 1;
+                               goto next_member;
                        }
                        st = tst; tst = NULL;
                        if (!auto_assem && inargv && tmpdev->next != NULL) {