On Nov 15, 2017, at 7:18 PM, Qu Wenruo <quwenruo.btrfs@xxxxxxx> wrote: > > [Background] > Recently I'm considering the possibility to use checksum from filesystem > to enhance device-mapper raid. > > The idea behind it is quite simple, since most modern filesystems have > checksum for their metadata, and even some (btrfs) have checksum for data. > > And for btrfs RAID1/10 (just ignore the RAID5/6 for now), at read time > it can use the checksum to determine which copy is correct so it can > return the correct data even one copy get corrupted. > > [Objective] > The final objective is to allow device mapper to do the checksum > verification (and repair if possible). > > If only for verification, it's not much different from current endio > hook method used by most of the fs. > However if we can move the repair part from filesystem (well, only btrfs > supports it yet), it would benefit all fs. I recall Darrick was looking into a mechanism to do this. Rather than changing the whole block layer to take a callback to do a checksum, what we looked at was to allow the upper-layer read to specify a "retry count" to the lower-layer block device. If the lower layer is able to retry the read then it will read a different device (or combination of devices for e.g. RAID-6) based on the retry count, until the upper layer gets a good read (based on checksum, or whatever). If there are no more devices (or combinations) to try then a final error is returned. Darrick can probably point at the original thread/patch. Cheers, Andreas
Attachment:
signature.asc
Description: Message signed with OpenPGP