• Qu Wenruo's avatar
    btrfs: make check_compressed_csum() to be subpage compatible · 04d4ba4c
    Qu Wenruo authored
    Currently check_compressed_csum() completely relies on sectorsize ==
    PAGE_SIZE to do checksum verification for compressed extents.
    
    To make it subpage compatible, this patch will:
    - Do extra calculation for the csum range
      Since we have multiple sectors inside a page, we need to only hash
      the range we want, not the full page anymore.
    
    - Do sector-by-sector hash inside the page
    
    With this patch and previous conversion on
    btrfs_submit_compressed_read(), now we can read subpage compressed
    extents properly, and do proper csum verification.
    Reviewed-by: default avatarAnand Jain <anand.jain@oracle.com>
    Signed-off-by: default avatarQu Wenruo <wqu@suse.com>
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    04d4ba4c
compression.c 44.6 KB