btrfs: fix filesystem corruption caused by space cache race
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest2 patches 26 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | btrfs: fix space cache corruption and potential double allocationsfs/ fs/ fs/ | +21 | 18 replies | |
| 2/2 | btrfs: get rid of block group caching progress logicfs/ fs/ fs/ +3 more | +2 | 4 replies |
Reviews trailers per patch
All 2 patches have a Reviewed-by or Acked-by.
| Patch | Filipe Manana |
|---|---|
| 1/2 | R-b |
| 2/2 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 0/2] btrfs: fix filesystem corruption caused by space cache race
From: Omar Sandoval <[email protected]>
Hello,
We recently deployed space_cache v2 on a large set of machines to do some performance comparisons and found a nasty filesystem corruption bug that was introduced by the fsync transaction optimization in 5.12. It's much more likely to affect space_cache=v2 and nospace_cache, but since space_cache=v1 effectively falls back to nospace_cache if there is a free space inode generation mismatch, space_cache=v1 could also theoretically be affected. discard/discard=sync also makes the bug much easier to hit by making the race window larger.
Patch 1 is the fix itself with a lot more details. Patch 2 is a followup cleanup.
I'm still working on a reproducer, but I wanted to get this fix out ASAP.
Thanks!
Omar Sandoval (2):
btrfs: fix space cache corruption and potential double allocations
btrfs: get rid of block group caching progress logic
fs/btrfs/block-group.c | 49 +++++++++++--------------------------- fs/btrfs/block-group.h | 5 +--- fs/btrfs/extent-tree.c | 39 +++++++----------------------- fs/btrfs/free-space-tree.c | 8 ------- fs/btrfs/transaction.c | 41 ------------------------------- fs/btrfs/zoned.c | 1 - 6 files changed, 23 insertions(+), 120 deletions(-)
Signature · 1 line
2.37.2