diff options
author | Dan Williams <dan.j.williams@intel.com> | 2010-07-19 23:59:25 +0200 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2010-07-19 23:59:25 +0200 |
commit | 1dccfff910ce9d854330302b9a34636d63cdac7b (patch) | |
tree | b031a618780c833d50f7dc82bbb9eeee270cb158 /Incremental.c | |
parent | imsm: fix a -O2 build warning (diff) | |
download | mdadm-1dccfff910ce9d854330302b9a34636d63cdac7b.tar.xz mdadm-1dccfff910ce9d854330302b9a34636d63cdac7b.zip |
Incremental: restore assembly for inactive containers, block active
GET_ARRAY_INFO always succeeds on an inactive container, so we need to
be a bit more diligent about adding a disk to an active container.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'Incremental.c')
-rw-r--r-- | Incremental.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Incremental.c b/Incremental.c index 96bfcec7..abfea243 100644 --- a/Incremental.c +++ b/Incremental.c @@ -376,7 +376,16 @@ int Incremental(char *devname, int verbose, int runstop, * statement about this. */ if (runstop < 1) { - if (ioctl(mdfd, GET_ARRAY_INFO, &ainf) == 0) { + int active = 0; + + if (st->ss->external) { + char *devname = devnum2devname(fd2devnum(mdfd)); + + active = devname && is_container_active(devname); + free(devname); + } else if (ioctl(mdfd, GET_ARRAY_INFO, &ainf) == 0) + active = 1; + if (active) { fprintf(stderr, Name ": not adding %s to active array (without --run) %s\n", devname, chosen_name); |