fixes for btrfs_read_folio races
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest2 patches 1 replyIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | btrfs: fix btrfs_read_folio race in relocationfs/ | +6 | 0 replies | |
| 2/2 | btrfs: fix btrfs_read_folio race in sendfs/ | +6 | 0 replies |
Reviews trailers per patch
None of the 2 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.
| Patch | Qu Wenruo |
|---|---|
| Series | R-b |
| 1/2 | |
| 2/2 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 0/2] fixes for btrfs_read_folio races
We have a common pattern of getting a folio (locked) checking if it is uptodate, then reading it with btrfs_read_folio if it is not.
btrfs_read_folio returns the folio unlocked, so we immediately lock it again with folio_lock. However, in the time that it is unlocked, a different thread can modify folio->mapping (like set it NULL with an invalidate) so we must also check that folio->mapping is still what we expect after folio_lock. Most users of btrfs_read_folio do it correctly (retry on mismatched folio->mapping), and this series tidies up a couple that were doing it wrong.
Boris Burkov (2):
btrfs: fix btrfs_read_folio race in relocation
btrfs: fix btrfs_read_folio race in send
fs/btrfs/relocation.c | 6 ++++++ fs/btrfs/send.c | 6 ++++++ 2 files changed, 12 insertions(+)
Signature · 1 line
2.47.0