From 1dccfff910ce9d854330302b9a34636d63cdac7b Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 19 Jul 2010 14:59:25 -0700 Subject: 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 --- Incremental.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'Incremental.c') 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); -- cgit