diff options
author | NeilBrown <neilb@suse.de> | 2014-07-10 07:54:02 +0200 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2014-07-10 07:54:02 +0200 |
commit | 5fe6f031d9a21a935f0ef1b1fbdb314b53f2199f (patch) | |
tree | 44f8fd5707a7a7ca7cde9a4abb1cf49c14e88466 /super-ddf.c | |
parent | IMSM: Add warning message when assemble spanned container (diff) | |
download | mdadm-5fe6f031d9a21a935f0ef1b1fbdb314b53f2199f.tar.xz mdadm-5fe6f031d9a21a935f0ef1b1fbdb314b53f2199f.zip |
mdmon: allow prepare_update to report failure.
If 'prepare_update' fails for some reason there is little
point continuing on to 'process_update'.
For now only malloc failures are caught, but other failures
will be considered in future.
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'super-ddf.c')
-rw-r--r-- | super-ddf.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/super-ddf.c b/super-ddf.c index ab9fc46f..1e43ca26 100644 --- a/super-ddf.c +++ b/super-ddf.c @@ -4906,8 +4906,8 @@ static void ddf_process_update(struct supertype *st, /* case DDF_SPARE_ASSIGN_MAGIC */ } -static void ddf_prepare_update(struct supertype *st, - struct metadata_update *update) +static int ddf_prepare_update(struct supertype *st, + struct metadata_update *update) { /* This update arrived at managemon. * We are about to pass it to monitor. @@ -4922,15 +4922,17 @@ static void ddf_prepare_update(struct supertype *st, offsetof(struct vcl, conf) + ddf->conf_rec_len * 512) != 0) { update->space = NULL; - return; + return 0; } vcl = update->space; vcl->conf.sec_elmnt_count = conf->sec_elmnt_count; if (alloc_other_bvds(ddf, vcl) != 0) { free(update->space); update->space = NULL; + return 0; } } + return 1; } /* |