Linux Btrfs filesystem development
 help / color / mirror / Atom feed
* [PATCH 0/5] btrfs: zoned: fix two deadlocks when runing fstests
@ 2026-07-16 11:56 Johannes Thumshirn
  2026-07-16 11:56 ` [PATCH 1/5] btrfs: factor out dirty-clearing part of btrfs_clear_buffer_dirty Johannes Thumshirn
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Johannes Thumshirn @ 2026-07-16 11:56 UTC (permalink / raw)
  To: linux-btrfs
  Cc: Qu Wenruo, Filipe Manana, Naohiro Aota, Damien Le Moal,
	Johannes Thumshirn

Fix two distinct deadlocks when running fstests:

- The first one happens primarily (but not only) on btrfs/187, Where we
  bunch up dirty metadata and then on umount try to submit it. But at
  the time of submission the block-group is already gone leaving stale
  folios behind that can't be written out. Patch 2 fixes it by clearing
  the stale buffers, patch 1 is a preparation patch for patch 2.

- The second one is a double lock of fs_info->ordered_extent_mutex when
  doing zone finish. It creates a copy of the roots that need to be
  finished and then does an unlocked version of
  btrfs_wait_ordered_roots() btrfs_wait_ordered_roots_nolock() on that
  copy.

For both issues debugging was done LLM assisted and I attributed it in
the respective fix patches (not the prep patches).

Johannes Thumshirn (5):
  btrfs: factor out dirty-clearing part of btrfs_clear_buffer_dirty
  btrfs: zoned: drop stale dirty btree buffers at close_ctree()
  btrfs: walk waited ordered extents in place
  btrfs: walk waited ordered roots in place
  btrfs: zoned: avoid ordered_operations_mutex when finishing a zone

 fs/btrfs/disk-io.c      |   4 ++
 fs/btrfs/extent_io.c    |  57 ++++++++++++------
 fs/btrfs/extent_io.h    |   1 +
 fs/btrfs/ordered-data.c | 129 +++++++++++++++++++++++++++++++++-------
 fs/btrfs/ordered-data.h |   4 ++
 fs/btrfs/zoned.c        |   8 ++-
 6 files changed, 159 insertions(+), 44 deletions(-)

-- 
2.54.0


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

end of thread, other threads:[~2026-07-17 22:45 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-16 11:56 [PATCH 0/5] btrfs: zoned: fix two deadlocks when runing fstests Johannes Thumshirn
2026-07-16 11:56 ` [PATCH 1/5] btrfs: factor out dirty-clearing part of btrfs_clear_buffer_dirty Johannes Thumshirn
2026-07-16 22:31   ` Qu Wenruo
2026-07-16 11:56 ` [PATCH 2/5] btrfs: zoned: drop stale dirty btree buffers at close_ctree() Johannes Thumshirn
2026-07-16 22:49   ` Qu Wenruo
2026-07-17  6:56     ` Johannes Thumshirn
2026-07-17 14:17     ` Johannes Thumshirn
2026-07-17 22:45       ` Qu Wenruo
2026-07-16 11:56 ` [PATCH 3/5] btrfs: walk waited ordered extents in place Johannes Thumshirn
2026-07-16 11:56 ` [PATCH 4/5] btrfs: walk waited ordered roots " Johannes Thumshirn
2026-07-16 11:56 ` [PATCH 5/5] btrfs: zoned: avoid ordered_operations_mutex when finishing a zone Johannes Thumshirn

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