Skip to content

RFC Btrfs: fix file data corruptions due to lost dirty bits

Chris Mason linux-btrfs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest2 patches 11 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2Btrfs: don't clean dirty pages during buffered writesfs/btrfs/file.c+24 -61 reply
2/2Btrfs: keep pages dirty when using btrfs_writepage_fixup_workerfs/btrfs/inode.c+49 -183 replies

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchDavid Sterba
1/2R-b
2/2

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 RFC 0/2] Btrfs: fix file data corruptions due to lost dirty bits

We've been hunting the root cause of data crc errors here at FB for a while. We'd find one or two corrupted files, usually displaying crc errors without any corresponding IO errors from the storage. The bug was rare enough that we'd need to watch a large number of machines for a few days just to catch it happening.

We're still running these patches through testing, but the fixup worker bug seems to account for the vast majority of crc errors we're seeing in the fleet. It's cleaning pages that were dirty, and creating a window where they can be reclaimed before we finish processing the page.

btrfs_file_write() has a similar bug when copy_from_user catches a page fault and we're writing to a page that was already dirty when file_write started. This one is much harder to trigger, and I haven't confirmed yet that we're seeing it in the fleet.