diff options
author | NeilBrown <neilb@suse.de> | 2008-10-30 09:34:04 +1100 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2008-10-30 09:34:04 +1100 |
commit | 2b4ca8f079335c1b3f345ec13da58699aaa0269d (patch) | |
tree | 290c0814ec02b3f81ff7148cc413c7ca6a55ef27 /Incremental.c | |
parent | 43aaf431f66270080368d4b33378bd3dc0fa1c96 (diff) | |
download | mdadm-2b4ca8f079335c1b3f345ec13da58699aaa0269d.tar.gz mdadm-2b4ca8f079335c1b3f345ec13da58699aaa0269d.tar.xz mdadm-2b4ca8f079335c1b3f345ec13da58699aaa0269d.zip |
Fix --incremental assembly of partitions arrays.
If incremental assembly finds an array mentioned in mdadm.conf,
with a 'standard partitioned' name like /dev/md_d0 or /dev/md/d0,
it will not create a partitioned array like it should.
This is because it mishandled the 'devnum' returned by
is_standard.
That is a devnum that does not have the partition-or-not encoded
into it. So we need to check the actual return value of
is_standard and encode the partition-or-not info into the devnum.
Also fix a couple of comments.
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'Incremental.c')
-rw-r--r-- | Incremental.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Incremental.c b/Incremental.c index 9c6524f..5d26b77 100644 --- a/Incremental.c +++ b/Incremental.c @@ -214,16 +214,16 @@ int Incremental(char *devname, int verbose, int runstop, } } /* 4/ Determine device number. */ - /* - If in mdadm.conf with std name, use that */ - /* - UUID in /var/run/mdadm.map use that */ + /* - If in mdadm.conf with std name, get number from name. */ + /* - UUID in /var/run/mdadm.map get number from mapping */ /* - If name is suggestive, use that. unless in use with */ /* different uuid. */ /* - Choose a free, high number. */ /* - Use a partitioned device unless strong suggestion not to. */ /* e.g. auto=md */ - if (match && is_standard(match->devname, &devnum)) - /* We have devnum now */; - else if ((mp = map_by_uuid(&map, info.uuid)) != NULL) + if (match && (rv = is_standard(match->devname, &devnum))) { + devnum = (rv > 0) ? (-1-devnum) : devnum; + } else if ((mp = map_by_uuid(&map, info.uuid)) != NULL) devnum = mp->devnum; else { /* Have to guess a bit. */ |