Computation support for RAID-TP (Triple Parity).

This commit is contained in:
Andrea Mazzoleni 2013-09-07 17:22:33 +02:00
parent 4f891087a2
commit 18840848e9
6 changed files with 1092 additions and 171 deletions

View file

@ -151,7 +151,7 @@ static int repair_step(struct snapraid_state* state, int rehash, unsigned pos, u
/* copy the redundancy to use */
memcpy(buffer[diskmax+1], buffer_qarity, state->block_size);
/* recover both data and p */
/* recover data */
raid6_recov_datap(buffer, diskmax, state->block_size, failed[failed_map[0]].index, buffer_zero);
hash_checked = 0; /* keep track if we check at least one block */
@ -181,9 +181,12 @@ static int repair_step(struct snapraid_state* state, int rehash, unsigned pos, u
/* copy the redundancy to use */
memcpy(buffer[diskmax+1], buffer_qarity, state->block_size);
/* recover both data and p */
/* recover data */
raid6_recov_datap(buffer, diskmax, state->block_size, failed[failed_map[0]].index, buffer_zero);
/* recompute parity with RAID5 to get p from it */
raid_gen(1, buffer, diskmax, state->block_size);
/* if the recovered parity block matches */
if (memcmp(buffer[diskmax], buffer_parity, state->block_size) == 0) {
/* recompute all the redundancy information */