NeilBrown: Assemble: handle container members better
Martin F. Krafft
madduck at alioth.debian.org
Tue Oct 27 19:21:59 UTC 2009
Module: mdadm
Branch: upstream
Commit: 8a0a0ded4af12be6db97abba7551923da3bcf8c9
URL: http://git.debian.org/?p=pkg-mdadm/mdadm.git;a=commit;h=8a0a0ded4af12be6db97abba7551923da3bcf8c9
Author: NeilBrown <neilb at suse.de>
Date: Mon Oct 19 17:08:04 2009 +1100
Assemble: handle container members better
When looking for a specific member, don't accept a
different member, but step on to the next one.
Signed-off-by: NeilBrown <neilb at suse.de>
---
Assemble.c | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/Assemble.c b/Assemble.c
index 54e725a..311666c 100644
--- a/Assemble.c
+++ b/Assemble.c
@@ -408,6 +408,9 @@ int Assemble(struct supertype *st, char *mddev,
fprintf(stderr, Name ": member %s in %s is already assembled\n",
content->text_version,
devname);
+ skip:
+ if (tmpdev->content)
+ goto next_member;
tst->ss->free_super(tst);
tst = NULL;
content = NULL;
@@ -415,6 +418,21 @@ int Assemble(struct supertype *st, char *mddev,
goto loop;
return 1;
}
+ if (ident->member && ident->member[0]) {
+ char *s = strchr(content->text_version+1, '/');
+ if (s == NULL) {
+ fprintf(stderr, Name ": badly formatted version: %s\n",
+ content->text_version);
+ goto skip;
+ }
+ if (strcmp(ident->member, s+1) != 0) {
+ if (report_missmatch)
+ fprintf(stderr,
+ Name ": skipping wrong member %s\n",
+ content->text_version);
+ goto skip;
+ }
+ }
st = tst; tst = NULL;
if (!auto_assem && tmpdev->next != NULL) {
fprintf(stderr, Name ": %s is a container, but is not "
More information about the pkg-mdadm-commits
mailing list