Re: [PATCH v2 08/11] ftrfs: add CRC32 checksumming and Reed-Solomon FEC skeleton

From: Aurelien DESBRIERES

Date: Sat Apr 18 2026 - 02:16:45 EST


On Tue, Apr 14, 2026 at 10:34:23AM -0700, Eric Biggers wrote:
> Is there a reason why the kernel's existing Reed-Solomon
> encoding/decoding library isn't being used?

No good reason. v2 had a custom GF(2^8) implementation - rolling our
own RS arithmetic when lib/reed_solomon exists is not justifiable.

v3 (<20260414120726.5713-1-aurelien@xxxxxxxxxxxx>) replaces the custom
code entirely. The codec is initialized at module load via:

init_rs(8, 0x187, 0, 1, 16)

encode_rs8/decode_rs8 are used for all RS operations. The custom
GF tables and encoder are gone.

The v2 custom encoder was also incorrect - it did not produce codewords
compatible with lib/reed_solomon. This would have caused silent
corruption on RS-protected blocks written by mkfs and read by the
kernel. Fixed in v3 and validated: mkfs parity matches lib/reed_solomon
byte-for-byte on arm64 kernel 7.0.

Aurelien DESBRIERES <aurelien@xxxxxxxxxxxx>