diff --git a/raid.c b/raid.c index c196807d..e1af3a4c 100644 --- a/raid.c +++ b/raid.c @@ -813,6 +813,81 @@ void raid_gen(unsigned level, unsigned char** buffer, unsigned diskmax, unsigned /****************************************************************************/ /* recovering */ +/** + * The data recovering is based on paper "The mathematics of RAID-6" [1], + * that covers the RAID5 and RAID6 computation in the Galois Field GF(2^8) + * with the primitive polinomial x^8 + x^4 + x^3 + x^2 + 1 (285 decimal), + * using generators "1" and "2". + * + * To support RAIDTP (Triple Parity), we use an extension of the same approach, + * described in the paper "Multiple-parity RAID" [2], with the additional + * generator "4". + * + * This method is also the same used by ZFS to implement its RAIDTP + * support. + * + * Note that the same extension is not possible for Quad Parity because + * in the approach used in the paper we don't have the guarantee to have a + * system of independent linear equations, and for Quad Parity in some cases + * the system is not solvable. + * A general method working for Quad Parity and more, can be found in [3] + * and corrected in [4], but with a slower computational performance. + * + * In details, Triple Parity is implemented for n disks Di, computing + * the syndromes P,Q,R with: + * + * P = sum(Di) 0<=i