diff options
author | NeilBrown <neilb@suse.de> | 2011-02-01 13:07:36 +1100 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2011-02-01 13:07:36 +1100 |
commit | e5e5d7cea390fd33d6be09ee6d8a47bc7695eb50 (patch) | |
tree | 1497f6c85b342cef648c1977401708f981598fbb /Incremental.c | |
parent | ac597b1c2134b4342df3c957fa054c34e522bee9 (diff) |
Incr: don't exclude 'active' devices from auto inclusion in a container.
For containers, it is always appropriate to include a device in the
container.
Whether it should then be included in an array is a separate question.
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'Incremental.c')
-rw-r--r-- | Incremental.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/Incremental.c b/Incremental.c index 7a4906dd..0d0a1fdc 100644 --- a/Incremental.c +++ b/Incremental.c @@ -358,22 +358,17 @@ int Incremental(char *devname, int verbose, int runstop, * array was possibly started early and our best bet is * to add this anyway. * Also if action policy is re-add or better we allow - * re-add + * re-add. + * This doesn't apply to containers as the 'non-spare' + * flag has a different meaning. The test has to happen + * at the device level there */ - if ((info.disk.state & (1<<MD_DISK_SYNC)) != 0 + if (!st->ss->external + && (info.disk.state & (1<<MD_DISK_SYNC)) != 0 && ! policy_action_allows(policy, st->ss->name, act_re_add) && runstop < 1) { - 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) { + if (ioctl(mdfd, GET_ARRAY_INFO, &ainf) == 0) { fprintf(stderr, Name ": not adding %s to active array (without --run) %s\n", devname, chosen_name); |