Skip to content

btrfs: fix a couple races between fsync and other code

[email protected] linux-btrfs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3btrfs: fix race between memory mapped writes and fsyncfs/btrfs/file.c+9 -90 replies
2/3btrfs: fix race between marking inode needs to be logged and log syncingfs/btrfs/btrfs_inode.h fs/btrfs/file.c fs/btrfs/inode.c +1 more+19 -120 replies
3/3btrfs: remove stale comment and logic from btrfs_inode_in_log()fs/btrfs/btrfs_inode.h+4 -130 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] btrfs: fix a couple races between fsync and other code

From: Filipe Manana <[email protected]>

The first patch fixes a race between fsync and memory mapped writes, which can result in corruptions. The second one fixes a different race that in practice should be "impossible" to happen, but in case it's triggered somehow, results in not logging an inode when it has new extents. The last patch just removes some no longer needed code.

The first patch, as mentioned in its changelog, depends on Josef's patchset which has the subject:

"Introduce a mmap sem to deal with some mmap issues"

The others are independent of it.

Filipe Manana (3):
btrfs: fix race between memory mapped writes and fsync
btrfs: fix race between marking inode needs to be logged and log
syncing
btrfs: remove stale comment and logic from btrfs_inode_in_log()

 fs/btrfs/btrfs_inode.h | 32 +++++++++++++++++++-------------
 fs/btrfs/file.c        | 28 +++++++++++-----------------
 fs/btrfs/inode.c       |  4 +---
 fs/btrfs/transaction.h |  2 +-
 4 files changed, 32 insertions(+), 34 deletions(-)
Signature · 1 line
2.28.0