Skip to content

btrfs: raid56: backports to reduce corruption

Qu Wenruo linux-btrfs stable 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2btrfs: only write the sectors in the vertical stripe which has data stripesfs/btrfs/raid56.c+49 -40 replies
2/2btrfs: raid56: don't trust any cached sector in __raid56_parity_recover()fs/btrfs/raid56.c+6 -90 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchDavid Sterba
SeriesA-b
1/2A-b
2/2A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH STABLE 5.19 0/2] btrfs: raid56: backports to reduce corruption

This backport is going to address the following possible corruption for btrfs RAID56:

- RMW always writes the full P/Q stripe
This happens even only some vertical stripes are dirty.

If some data sectors are corrupted in the clean vertical stripes, then such unnecessary P/Q updates will wipe the chance or recovery, as the P/Q will be calculated using corrupted data.

This will be addressed by the first backport patch.

- Don't trust any cached sector when doing recovery Although above patch will avoid unnecessary P/Q writes, the full P/Q stripe will still be updated in the in-memory only RAID56 cache.

To properly recovery data stripes, we should not trust any cached sector, and always read data from disk, which will avoid corrupted P/Q sectors.

This will be addressed by the second backport patch.

This would make some previously always-fail test cases, like btrfs/125, to pass, and end users have a lower chance to corrupt their RAID56 data.

Since this is a data corruption related fix, these backport patches are needed for all stable branches.

Unfortunately due to the new cleanups in v6.0-rc, these backport patches have quite some conflicts (even for 5.19), and have to be manually resolved. Almost every stable branch will need their own backports.

Qu Wenruo (2):
btrfs: only write the sectors in the vertical stripe which has data
stripes
btrfs: raid56: don't trust any cached sector in

    __raid56_parity_recover()
 fs/btrfs/raid56.c | 68 ++++++++++++++++++++++++++++++++++++++---------
 1 file changed, 55 insertions(+), 13 deletions(-)
Signature · 1 line
2.37.1