OSDN Git Service

btrfs: only require sector size alignment for page read
authorQu Wenruo <wqu@suse.com>
Wed, 21 Oct 2020 06:24:58 +0000 (14:24 +0800)
committerDavid Sterba <dsterba@suse.com>
Tue, 8 Dec 2020 14:53:56 +0000 (15:53 +0100)
commit8b8bbd461ea180470041fa84c745480163bb908f
tree708e2d3433a343c8631033ecdbcf4c6ac370025d
parent12e3360f74759de1031738b85743b429aef3dc8c
btrfs: only require sector size alignment for page read

If we're reading partial page, btrfs will warn about this as read/write
is always done in sector size, which now equals page size.

But for the upcoming subpage read-only support, our data read is only
aligned to sectorsize, which can be smaller than page size.

Thus here we change the warning condition to check it against
sectorsize, the behavior is not changed for regular sectorsize ==
PAGE_SIZE case, and won't report error for subpage read.

Also, pass the proper start/end with bv_offset for check_data_csum() to
handle.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent_io.c