X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=raid6check.c;h=551f8355bd69d45275ba443695883838e94f5870;hb=1ab97c976b3f1cdc6d36d72a42ae863188555732;hp=b2e173233ca6ef2853acb298661b27a4ff3d7f04;hpb=eae01ef02fe3a7dd9b71129343f905ac212c6658;p=thirdparty%2Fmdadm.git diff --git a/raid6check.c b/raid6check.c index b2e17323..551f8355 100644 --- a/raid6check.c +++ b/raid6check.c @@ -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 { @@ -312,7 +313,7 @@ int check_stripes(struct mdinfo *info, int *source, unsigned long long *offsets, /* read the data and p and q blocks, and check we got them right */ int data_disks = raid_disks - 2; int syndrome_disks = data_disks + is_ddf(layout) * 2; - char *stripe_buf = xmalloc(raid_disks * chunk_size); + char *stripe_buf; /* stripes[] is indexed by raid_disk and holds chunks from each device */ char **stripes = xmalloc(raid_disks * sizeof(char*)); @@ -349,6 +350,8 @@ int check_stripes(struct mdinfo *info, int *source, unsigned long long *offsets, if (!tables_ready) make_tables(); + if (posix_memalign((void**)&stripe_buf, 4096, raid_disks * chunk_size) != 0) + exit(4); block_index_for_slot += 2; blocks += 2; blocks_page += 2; @@ -675,7 +678,7 @@ int main(int argc, char *argv[]) if(disk_slot >= 0) { disk_name[disk_slot] = map_dev(comp->disk.major, comp->disk.minor, 0); offsets[disk_slot] = comp->data_offset * 512; - fds[disk_slot] = open(disk_name[disk_slot], O_RDWR | O_SYNC); + fds[disk_slot] = open(disk_name[disk_slot], O_RDWR | O_DIRECT); if (fds[disk_slot] < 0) { perror(disk_name[disk_slot]); fprintf(stderr,"%s: cannot open %s\n", prg, disk_name[disk_slot]);