Commit 00d8252
btrfs: fix direct I/O read repair for split bios
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.
The logic was removed in f4f39fc ("btrfs: remove btrfs_bio::logical
member") but we need it due to the bio splitting.
CC: stable@vger.kernel.org # 5.16+
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Naohiro Aota <naohiro.aota@wdc.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Sweet Tea Dorminy <sweettea-kernel@dorminy.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: David Sterba <dsterba@suse.com>1 parent 50f1cff commit 00d8252
3 files changed
Lines changed: 9 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2658 | 2658 | | |
2659 | 2659 | | |
2660 | 2660 | | |
| 2661 | + | |
2661 | 2662 | | |
2662 | 2663 | | |
2663 | 2664 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7809 | 7809 | | |
7810 | 7810 | | |
7811 | 7811 | | |
7812 | | - | |
7813 | | - | |
7814 | 7812 | | |
7815 | 7813 | | |
7816 | 7814 | | |
| |||
7820 | 7818 | | |
7821 | 7819 | | |
7822 | 7820 | | |
| 7821 | + | |
| 7822 | + | |
7823 | 7823 | | |
7824 | 7824 | | |
7825 | 7825 | | |
| |||
7832 | 7832 | | |
7833 | 7833 | | |
7834 | 7834 | | |
7835 | | - | |
7836 | | - | |
7837 | | - | |
7838 | | - | |
7839 | | - | |
| 7835 | + | |
| 7836 | + | |
7840 | 7837 | | |
7841 | 7838 | | |
7842 | 7839 | | |
7843 | 7840 | | |
7844 | 7841 | | |
7845 | | - | |
7846 | 7842 | | |
7847 | 7843 | | |
7848 | 7844 | | |
| |||
8045 | 8041 | | |
8046 | 8042 | | |
8047 | 8043 | | |
| 8044 | + | |
8048 | 8045 | | |
8049 | 8046 | | |
8050 | 8047 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
328 | 328 | | |
329 | 329 | | |
330 | 330 | | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
331 | 334 | | |
332 | 335 | | |
333 | 336 | | |
| |||
0 commit comments