Re: [PATCH 1/2] btrfs: fix direct I/O read repair for split bios

David Sterba
2022-03-30T14:48:03Z

On Thu, Mar 24, 2022 at 05:06:27PM +0100, Christoph Hellwig wrote:
> When a bio is split in btrfs_submit_direct, dip->file_offset contains
> the file offset for the first bio. But this means the start value used
> in btrfs_check_read_dio_bio is incorrect for subsequent bios. Add
> a file_offset field to struct btrfs_bio to pass along the correct offset.
>
> Given that check_data_csum only uses start of an error message this
> means problems with this miscalculation will only show up when I/O
> fails or checksums mismatch.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> Reviewed-by: Qu Wenruo <wqu@suse.com>

Qu, you've removed the same logic in f4f39fc5dc30 ("btrfs: remove
btrfs_bio::logical member") where it was a different name for the same
variable. What changed in the logic that we don't need to store it along
the btrfs_bio and that btrfs_dio_private can't provide anymore?

I'm a bit worried about your changes that remove/rewrite code, silently
introducing bugs so it has to be reinstated. We don't have enough
review coverage and in the amount of patches you send I'm increasingly
worried how many bugs I've inadvertently let in.