summaryrefslogtreecommitdiffstats
path: root/super-intel.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2008-11-27 15:39:59 +1100
committerNeilBrown <neilb@suse.de>2008-11-27 15:39:59 +1100
commit208933a7a839d60e48efc90450c6ed3c0f6873e2 (patch)
treedf5bf3172dc1fd2f8fadc76c69a7152e23420679 /super-intel.c
parentf20c3968363a16f3c8dce5d69863bbb54a4d236e (diff)
downloadmdadm-208933a7a839d60e48efc90450c6ed3c0f6873e2.tar.gz
mdadm-208933a7a839d60e48efc90450c6ed3c0f6873e2.tar.xz
mdadm-208933a7a839d60e48efc90450c6ed3c0f6873e2.zip
Tidy error messages for add_to_super failure.
Make sure every failure from add_to_super prints a suitable error message, and then don't print any error in the caller. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'super-intel.c')
-rw-r--r--super-intel.c10
1 files changed, 9 insertions, 1 deletions
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) {