Linux Btrfs filesystem development
 help / color / mirror / Atom feed
* [PATCH 0/3] btrfs: avoid data races when accessing an inode's delayed_node
@ 2024-05-17 13:13 fdmanana
  2024-05-17 13:13 ` [PATCH 1/3] btrfs: always set an inode's delayed_inode with WRITE_ONCE() fdmanana
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: fdmanana @ 2024-05-17 13:13 UTC (permalink / raw)
  To: linux-btrfs

From: Filipe Manana <fdmanana@suse.com>

We do have some data races when accessing an inode's delayed_node, namely
we use READ_ONCE() in a couple places while there's no pairing WRITE_ONCE()
anywhere, and in one place (btrfs_dirty_inode()) we neither user READ_ONCE()
nor take the lock that protects the delayed_node. So fix these and add
helpers to access and update an inode's delayed_node.

Filipe Manana (3):
  btrfs: always set an inode's delayed_inode with WRITE_ONCE()
  btrfs: use READ_ONCE() when accessing delayed_node at btrfs_dirty_node()
  btrfs: add and use helpers to get and set an inode's delayed_node

 fs/btrfs/btrfs_inode.h   | 12 ++++++++++++
 fs/btrfs/delayed-inode.c | 10 +++++-----
 fs/btrfs/inode.c         |  4 ++--
 3 files changed, 19 insertions(+), 7 deletions(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2024-05-21 14:47 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-17 13:13 [PATCH 0/3] btrfs: avoid data races when accessing an inode's delayed_node fdmanana
2024-05-17 13:13 ` [PATCH 1/3] btrfs: always set an inode's delayed_inode with WRITE_ONCE() fdmanana
2024-05-17 22:51   ` Qu Wenruo
2024-05-17 13:13 ` [PATCH 2/3] btrfs: use READ_ONCE() when accessing delayed_node at btrfs_dirty_node() fdmanana
2024-05-17 22:51   ` Qu Wenruo
2024-05-17 13:13 ` [PATCH 3/3] btrfs: add and use helpers to get and set an inode's delayed_node fdmanana
2024-05-17 22:51   ` Qu Wenruo
2024-05-20 15:48 ` [PATCH 0/3] btrfs: avoid data races when accessing " David Sterba
2024-05-20 16:58   ` Filipe Manana
2024-05-20 20:20     ` David Sterba
2024-05-21 14:47       ` David Sterba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox