[PATCH 0/5] btrfs: zoned: fix two deadlocks when runing fstests
Johannes Thumshirn <[email protected]>
| Newsgroups | org.kernel.vger.linux-btrfs |
|---|---|
| Message-ID | <[email protected]> |
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