summaryrefslogtreecommitdiffstats
path: root/super-ddf.c
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2008-11-26 15:39:51 -0700
committerNeilBrown <neilb@suse.de>2008-11-27 15:30:39 +1100
commitf20c3968363a16f3c8dce5d69863bbb54a4d236e (patch)
treec96904d976647f1051b9f3dbc2cf72c27b428624 /super-ddf.c
parentfabbfd48b6c2398a344d2d4f7cbf0ab98181a6d4 (diff)
downloadmdadm-f20c3968363a16f3c8dce5d69863bbb54a4d236e.tar.gz
mdadm-f20c3968363a16f3c8dce5d69863bbb54a4d236e.tar.xz
mdadm-f20c3968363a16f3c8dce5d69863bbb54a4d236e.zip
allow add_to_super to return errors
Prepare add_to_super to validate disks against the platform capabilities Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'super-ddf.c')
-rw-r--r--super-ddf.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/super-ddf.c b/super-ddf.c
index 3e78ffc..3c97bb6 100644
--- a/super-ddf.c
+++ b/super-ddf.c
@@ -2050,7 +2050,7 @@ static void add_to_super_ddf_bvd(struct supertype *st,
/* add a device to a container, either while creating it or while
* expanding a pre-existing container
*/
-static void add_to_super_ddf(struct supertype *st,
+static int add_to_super_ddf(struct supertype *st,
mdu_disk_info_t *dk, int fd, char *devname)
{
struct ddf_super *ddf = st->sb;
@@ -2064,7 +2064,7 @@ static void add_to_super_ddf(struct supertype *st,
if (ddf->currentconf) {
add_to_super_ddf_bvd(st, dk, fd, devname);
- return;
+ return 0;
}
/* This is device numbered dk->number. We need to create
@@ -2076,7 +2076,7 @@ static void add_to_super_ddf(struct supertype *st,
fprintf(stderr, Name
": %s could allocate buffer for new disk, aborting\n",
__func__);
- abort();
+ return 1;
}
dd->major = major(stb.st_rdev);
dd->minor = minor(stb.st_rdev);
@@ -2147,6 +2147,8 @@ static void add_to_super_ddf(struct supertype *st,
ddf->dlist = dd;
ddf->updates_pending = 1;
}
+
+ return 0;
}
/*