Skip to content

btrfs: fixes for races when checking if an inode was logged before

[email protected] linux-btrfs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3btrfs: fix race between logging inode and checking if it was logged beforefs/btrfs/tree-log.c+30 -60 replies
2/3btrfs: fix race between setting last_dir_index_offset and inode loggingfs/btrfs/btrfs_inode.h fs/btrfs/inode.c fs/btrfs/tree-log.c+4 -160 replies
3/3btrfs: avoid load/store tearing races when checking if an inode was loggedfs/btrfs/tree-log.c+21 -40 replies

Reviews trailers per patch

None of the 3 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchBoris Burkov
SeriesR-b
1/3
2/3
3/3

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 0/3] btrfs: fixes for races when checking if an inode was logged before

From: Filipe Manana <[email protected]>

The first patch is actually a new version of a patch sent out before [1], because holding the inode's log_mutex at inode_logged() can make lockdep unhappy in situations like when logging conflicting inodes, where we are already holding the log_mutex of some other inode and could potentially result in a ABBA deadlock.

The second patch splits part of what the initial version of patch 1 fixed, but with a different solution that makes the management of an inode's last_dir_index_offset field simpler.

Patch 3 is completely new.

Details in the change logs.

[1] - https://lore.kernel.org/linux-btrfs/7585d15c0e9c163d5cdf32307014a4e792e62541.1753807163.git.fdmanana@suse.com/

Filipe Manana (3):
btrfs: fix race between logging inode and checking if it was logged before
btrfs: fix race between setting last_dir_index_offset and inode logging
btrfs: avoid load/store tearing races when checking if an inode was logged

 fs/btrfs/btrfs_inode.h |  2 +-
 fs/btrfs/inode.c       |  1 +
 fs/btrfs/tree-log.c    | 78 ++++++++++++++++++++++++++++--------------
 3 files changed, 55 insertions(+), 26 deletions(-)
Signature · 1 line
2.47.2