btrfs: fix check_data_csum() error message for direct I/O

Commit 1dae796aabf6 ("btrfs: inode: sink parameter start and len to
check_data_csum()") replaced the start parameter to check_data_csum()
with page_offset(), but page_offset() is not meaningful for direct I/O
pages. Bring back the start parameter.

Fixes: 265d4ac03fdf ("btrfs: sink parameter start and len to check_data_csum")
CC: stable@vger.kernel.org # 5.11+
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Omar Sandoval <osandov@fb.com>
Signed-off-by: David Sterba <dsterba@suse.com>

authored by Omar Sandoval and committed by David Sterba c1d6abda 0bb78830

Changed files
+9 -5
fs
btrfs
+9 -5
fs/btrfs/inode.c
··· 3099 3099 * @bio_offset: offset to the beginning of the bio (in bytes) 3100 3100 * @page: page where is the data to be verified 3101 3101 * @pgoff: offset inside the page 3102 + * @start: logical offset in the file 3102 3103 * 3103 3104 * The length of such check is always one sector size. 3104 3105 */ 3105 3106 static int check_data_csum(struct inode *inode, struct btrfs_io_bio *io_bio, 3106 - u32 bio_offset, struct page *page, u32 pgoff) 3107 + u32 bio_offset, struct page *page, u32 pgoff, 3108 + u64 start) 3107 3109 { 3108 3110 struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb); 3109 3111 SHASH_DESC_ON_STACK(shash, fs_info->csum_shash); ··· 3132 3130 kunmap_atomic(kaddr); 3133 3131 return 0; 3134 3132 zeroit: 3135 - btrfs_print_data_csum_error(BTRFS_I(inode), page_offset(page) + pgoff, 3136 - csum, csum_expected, io_bio->mirror_num); 3133 + btrfs_print_data_csum_error(BTRFS_I(inode), start, csum, csum_expected, 3134 + io_bio->mirror_num); 3137 3135 if (io_bio->device) 3138 3136 btrfs_dev_stat_inc_and_print(io_bio->device, 3139 3137 BTRFS_DEV_STAT_CORRUPTION_ERRS); ··· 3186 3184 pg_off += sectorsize, bio_offset += sectorsize) { 3187 3185 int ret; 3188 3186 3189 - ret = check_data_csum(inode, io_bio, bio_offset, page, pg_off); 3187 + ret = check_data_csum(inode, io_bio, bio_offset, page, pg_off, 3188 + page_offset(page) + pg_off); 3190 3189 if (ret < 0) 3191 3190 return -EIO; 3192 3191 } ··· 7910 7907 ASSERT(pgoff < PAGE_SIZE); 7911 7908 if (uptodate && 7912 7909 (!csum || !check_data_csum(inode, io_bio, 7913 - bio_offset, bvec.bv_page, pgoff))) { 7910 + bio_offset, bvec.bv_page, 7911 + pgoff, start))) { 7914 7912 clean_io_failure(fs_info, failure_tree, io_tree, 7915 7913 start, bvec.bv_page, 7916 7914 btrfs_ino(BTRFS_I(inode)),