]> 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 8c8e886cfd676ded831f09671921767519cd2c6a..1e43ca26f8858b45f8d0ac85c67717444ac00862 100644 (file)
@@ -1758,6 +1758,7 @@ static void detail_super_ddf(struct supertype *st, char *homehost)
        printf("  Virtual Disks : %d\n", cnt);
        printf("\n");
 }
+#endif
 
 static const char *vendors_with_variable_volume_UUID[] = {
        "LSI      ",
@@ -1804,6 +1805,7 @@ static void uuid_of_ddf_subarray(const struct ddf_super *ddf,
        memcpy(uuid, sha, 4*4);
 }
 
+#ifndef MDASSEMBLE
 static void brief_detail_super_ddf(struct supertype *st)
 {
        struct mdinfo info;
@@ -2074,7 +2076,7 @@ static void getinfo_super_ddf_bvd(struct supertype *st, struct mdinfo *info, cha
        int cd = ddf->currentdev;
        int n_prim;
        int j;
-       struct dl *dl;
+       struct dl *dl = NULL;
        int map_disks = info->array.raid_disks;
        __u32 *cptr;
        struct vd_config *conf;
@@ -4904,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.
@@ -4920,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;
 }
 
 /*