OSDN Git Service

btrfs: use iosize while reading compressed pages
authorGoldwyn Rodrigues <rgoldwyn@suse.de>
Tue, 15 Sep 2020 15:41:40 +0000 (10:41 -0500)
committerDavid Sterba <dsterba@suse.com>
Tue, 8 Dec 2020 14:53:37 +0000 (15:53 +0100)
commit949b32732eab33018283e0517cc528be10a3d085
tree86a671f0fc5283014f3aab027eff9a0d7a719eef
parenteefa45f593792827771cfd845ab12fea5a7c7cd9
btrfs: use iosize while reading compressed pages

While using compression, a submitted bio is mapped with a compressed bio
which performs the read from disk, decompresses and returns uncompressed
data to original bio. The original bio must reflect the uncompressed
size (iosize) of the I/O to be performed, or else the page just gets the
decompressed I/O length of data (disk_io_size). The compressed bio
checks the extent map and gets the correct length while performing the
I/O from disk.

This came up in subpage work when only compressed length of the original
bio was filled in the page. This worked correctly for pagesize ==
sectorsize because both compressed and uncompressed data are at pagesize
boundaries, and would end up filling the requested page.

Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent_io.c