diff options
-rw-r--r-- | Create.c | 5 | ||||
-rw-r--r-- | Manage.c | 2 | ||||
-rw-r--r-- | super-intel.c | 10 |
3 files changed, 10 insertions, 7 deletions
@@ -706,11 +706,8 @@ int Create(struct supertype *st, char *mddev, remove_partitions(fd); if (st->ss->add_to_super(st, &inf->disk, - fd, dv->devname)) { - fprintf(stderr, Name ": failed to add %s\n", - dv->devname); + fd, dv->devname)) goto abort; - } st->ss->getinfo_super(st, inf); safe_mode_delay = inf->safe_mode_delay; @@ -626,8 +626,6 @@ int Manage_subdevs(char *devname, int fd, dfd = open(dv->devname, O_RDWR | O_EXCL|O_DIRECT); if (tst->ss->add_to_super(tst, &disc, dfd, dv->devname)) { - fprintf(stderr, Name ": failed to add %s\n", - dv->devname); close(dfd); return 1; } diff --git a/super-intel.c b/super-intel.c index d39b88ca..5d8944c 100644 --- a/super-intel.c +++ b/super-intel.c @@ -1923,13 +1923,21 @@ static int add_to_super_imsm_volume(struct supertype *st, mdu_disk_info_t *dk, dev = get_imsm_dev(super, super->current_vol); map = get_imsm_map(dev, 0); + if (! (dk->state & (1<<MD_DISK_SYNC))) { + fprintf(stderr, Name ": %s: Cannot add spare devices to IMSM volume\n", + devname); + return 1; + } + for (dl = super->disks; dl ; dl = dl->next) if (dl->major == dk->major && dl->minor == dk->minor) break; - if (!dl || ! (dk->state & (1<<MD_DISK_SYNC))) + if (!dl) { + fprintf(stderr, Name ": %s is not a member of the same container\n", devname); return 1; + } /* add a pristine spare to the metadata */ if (dl->index < 0) { |