]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - raid6check.c
Detail: fix segfault during IMSM raid creation
[thirdparty/mdadm.git] / raid6check.c
index cb8522e523a6e26610878a9921ef8fc971df32a3..a8e6005bc1be5f6936cd4242b0921156578390b3 100644 (file)
@@ -266,7 +266,8 @@ int manual_repair(int chunk_size, int syndrome_disks,
                                failed_data = failed_slot2;
                        else
                                failed_data = failed_slot1;
-                               printf("Repairing D(%d) and P\n", failed_data);
+
+                       printf("Repairing D(%d) and P\n", failed_data);
                        raid6_datap_recov(syndrome_disks+2, chunk_size,
                                          failed_data, (uint8_t**)blocks, 1);
                } else {
@@ -349,7 +350,8 @@ int check_stripes(struct mdinfo *info, int *source, unsigned long long *offsets,
        if (!tables_ready)
                make_tables();
 
-       posix_memalign((void**)&stripe_buf, 4096, raid_disks * chunk_size);
+       if (posix_memalign((void**)&stripe_buf, 4096, raid_disks * chunk_size) != 0)
+               exit(4);
        block_index_for_slot += 2;
        blocks += 2;
        blocks_page += 2;
@@ -560,7 +562,7 @@ int main(int argc, char *argv[])
                          GET_LEVEL|
                          GET_LAYOUT|
                          GET_DISKS|
-                         GET_DEGRADED |
+                         GET_STATE |
                          GET_COMPONENT|
                          GET_CHUNK|
                          GET_DEVS|