failed_data, (uint8_t**)blocks, 1);
} else {
printf("Repairing D and D\n");
- if (failed_slot1 > failed_slot2) {
- int t = failed_slot1;
- failed_slot1 = failed_slot2;
- failed_slot2 = t;
- }
raid6_2data_recov(syndrome_disks+2, chunk_size,
failed_slot1, failed_slot2,
(uint8_t**)blocks, 1);
/* 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*));
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;
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]);