btrfs: raid56: make raid56 to use more accurate error bitmap for error detection
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest3 patches 2 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | btrfs: raid56: introduce btrfs_raid_bio::error_bitmapfs/ fs/ | +108 | 1 reply | |
| 2/3 | btrfs: raid56: migrate recovery and scrub recovery path to use error_bitmapfs/ | +195 | 0 replies | |
| 3/3 | btrfs: raid56: remove the old error tracing systemfs/ fs/ | +55 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/3] btrfs: raid56: make raid56 to use more accurate error bitmap for error detection
Currently btrfs raid56 uses stripe based error detection.
This means, any error (which vary from single sector csum mismatch, to a missing device) will mark the whole horizontal stripe as error.
This can lead to some unexpected behavior, for example:
0 32K 64K
Data 1 |XXXXXXXX| |
Data 2 | |XXXXXXXXX|
Parity | | |When reading data 1 [0, 32K), we got csum mismatch and go RAID56 recovery path.
If going the old path, we will mark the whole data 1 [0, 64K) all as error, and recover using data 2 and parity.
But since data 2 [32K, 64K) is also corrupted, the recovered data will also be corrupted.
Thankfully such problem will be mostly avoided after commit f6065f8edeb2 ("btrfs: raid56: don't trust any cached sector in __raid56_parity_recover()"), as when we read the sectors in data 2 [32K, 64K), we will recover discarding all the cached result.
This patchset will change the behavior by introducing an error bitmap, recording corrupted sector one by one, so for above case, at least we won't try to recover data 1 [32K, 64K) using incorrect data.
The true solution to this destructive RMW problem will be read time csum verification, but this patchset introduces the basis to handle extra csum mismatch error better (csum mismatch will also be marked as error, but only for the offending sectors).
This patchset itself doesn't improve the raid56 destructive RMW situation by itself, but would make later destructive RMW fix much easier to implement.
Qu Wenruo (3):
btrfs: raid56: introduce btrfs_raid_bio::error_bitmap
btrfs: raid56: migrate recovery and scrub recovery path to use
error_bitmap
btrfs: raid56: remove the old error tracing system
fs/btrfs/raid56.c | 572 ++++++++++++++++++++++++++-------------------- fs/btrfs/raid56.h | 19 +- 2 files changed, 334 insertions(+), 257 deletions(-)
Signature · 1 line
2.38.1