Fix error handling on data bio submission
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest8 patches 5 repliesIn review
- v18 patches 11 repliesSuperseded
Changes in v2 from the cover letter
- addressed the various comments, expanded on the comment about NODATASUM and the DATA_RELOC inode since I had to look up why we even had that there.
- Added the various reviewed-by's on the patches I didn't touch.
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/8 | btrfs: make search_csum_tree return 0 if we get -EFBIGfs/ | +1 | 0 replies | |
| 2/8 | btrfs: handle csum lookup errors properly on readsfs/ | +27 | 3 replies | |
| 3/8 | btrfs: check correct bio in finish_compressed_bio_readfs/ | +1 | 0 replies | |
| 4/8 | btrfs: remove the bio argument from finish_compressed_bio_readfs/ | +3 | 0 replies | |
| 5/8 | btrfs: track compressed bio errors as blk_status_tfs/ fs/ | +16 | 0 replies | |
| 6/8 | btrfs: do not double complete bio on errors during compressed readsfs/ fs/ | +22 | 1 reply | |
| 7/8 | btrfs: do not try to repair bio that has no mirror setfs/ | +9 | 0 replies | |
| 8/8 | btrfs: do not clean up repair bio if submit failsfs/ | +8 | 0 replies |
Reviews trailers per patch
5 of 8 patches have a Reviewed-by or Acked-by.
| Patch | Boris Burkov | Johannes Thumshirn |
|---|---|---|
| 1/8 | R-b | R-b |
| 2/8 | ||
| 3/8 | R-b | R-b |
| 4/8 | R-b | |
| 5/8 | ||
| 6/8 | ||
| 7/8 | R-b | |
| 8/8 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v2 0/8] Fix error handling on data bio submission
v1->v2:
- addressed the various comments, expanded on the comment about NODATASUM and the DATA_RELOC inode since I had to look up why we even had that there.
- Added the various reviewed-by's on the patches I didn't touch.
--- Original email ---
Internally we tried to enable a remediation to automatically re-provision machines that had checksum errors. This was based on dmesg scanning, however we discovered that we were getting transienty csum error messages. This came down to getting a transient ENOMEM while trying to lookup checksums while doing a data read (this was on memory constrained containers).
What we were doing was simply acting like there wasn't a checksum there, which would print a scary message about missing checksums. And then we'd do the read, but because we didn't have a checksum we'd complain about a checksum mismatch. Neither of these things were actually what was happening, we simply got an EIO while looking up the checksums.
Fix this by properly returning an error and erroring out the BIO with the correct error. This is actually correct, it allows us to skip the IO and also not erroneously tell the user that their checksums are invalid.
While testing this fix however I uncovered a variety of problems with our error handling when we submit. So the first two patches are to fix the main problem I wanted to fix, and the next 6 are to fix problems that happen when injecting errors into the checksum lookup path.
With these patches I'm no longer getting csum mismatch errors when I fail to lookup csums, and I'm also able to survive a xfstests run while randomly injecting errors into this path. Thanks,
Josef
Josef Bacik (8):
btrfs: make search_csum_tree return 0 if we get -EFBIG
btrfs: handle csum lookup errors properly on reads
btrfs: check correct bio in finish_compressed_bio_read
btrfs: remove the bio argument from finish_compressed_bio_read
btrfs: track compressed bio errors as blk_status_t
btrfs: do not double complete bio on errors during compressed reads
btrfs: do not try to repair bio that has no mirror set
btrfs: do not clean up repair bio if submit fails
fs/btrfs/compression.c | 58 ++++++++++++++++++++++++------------------ fs/btrfs/compression.h | 2 +- fs/btrfs/extent_io.c | 25 ++++++++++++------ fs/btrfs/file-item.c | 43 ++++++++++++++++++++----------- fs/btrfs/inode.c | 12 ++++++--- 5 files changed, 87 insertions(+), 53 deletions(-)
Signature · 1 line
2.26.3