summaryrefslogtreecommitdiffstats
path: root/Incremental.c
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2010-07-19 14:59:25 -0700
committerDan Williams <dan.j.williams@intel.com>2010-07-19 14:59:25 -0700
commit1dccfff910ce9d854330302b9a34636d63cdac7b (patch)
treeb031a618780c833d50f7dc82bbb9eeee270cb158 /Incremental.c
parent569cc43ffb0634510defee91407d261555c7a991 (diff)
downloadmdadm-1dccfff910ce9d854330302b9a34636d63cdac7b.tar.gz
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.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/Incremental.c b/Incremental.c
index 96bfcec..abfea24 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);