]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - super-ddf.c
mdmon: allow prepare_update to report failure.
[thirdparty/mdadm.git] / super-ddf.c
index ab9fc46fae4d50bda367d5a5974c7937e605a5c2..1e43ca26f8858b45f8d0ac85c67717444ac00862 100644 (file)
@@ -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;
 }
 
 /*