[RFC 0/3] Btrfs checksum offload

Johannes Thumshirn Johannes.Thumshirn at wdc.com
Mon Feb 3 06:41:33 PST 2025


On 03.02.25 15:04, Kanchan Joshi wrote:
> On 2/3/2025 7:10 PM, Johannes Thumshirn wrote:
>> But NODATASUM isn't something that is actively recommended unless you
>> know what you're doing. I thought of your patches as an offload of the
>> checksum tree to the T10-PI extended sector format
> 
> You thought right, patches do "offload to T10-PI format" part. That part
> is generic for any upper-layer user. One only needs to send flag
> REQ_INTEGRITY_OFFLOAD for that.

That one I think is nice.

> And for the other part "suppress data-csums at Btrfs level", I thought
> of using NODATASUM.
> 

That one I hate with passion, IFF done the way it's done in this patchset.

For the generation/write side you can go that way. But it needs to be 
wired up so that btrfs can be the consumer (is this the correct term 
here?) of the checksums as well. Luckily 'btrfs_check_read_bio()' 
treats bio.bi_ioerror != BLK_STS_OK the same way as
!btrfs_data_csum_ok(). So that part looks save to me. Also 
btrfs_data_csum_ok() does an early return if there's no checsum, so I 
think we're good there.

In order to make scrub (and RAID5) work, you'd need a fallback for 
'btrfs_lookup_csums_bitmap()' that returns the sector checksum from the 
bio integrity layer instead of looking at the checksum tree.


More information about the Linux-nvme mailing list