public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] btrfs: fix the delayed iputs ASSERT() when the fs
@ 2025-03-07  4:26 Qu Wenruo
  2025-03-07  4:26 ` [PATCH 1/2] btrfs: run btrfs_error_commit_super() early Qu Wenruo
  2025-03-07  4:26 ` [PATCH 2/2] btrfs: add extra warning if delayed iput is added when it's not allowed Qu Wenruo
  0 siblings, 2 replies; 6+ messages in thread
From: Qu Wenruo @ 2025-03-07  4:26 UTC (permalink / raw)
  To: linux-btrfs; +Cc: fdmanana

Although Filipe fixes a lot of cases where the delayed iputs ASSERT()
can be triggered, that's all focusing on the common cases where the fs
is still in a good shape.

However in my experimental 2K block size runs, the test case generic/475
has a very high chance that the emulated error makes the fs to flips
into an error status.

That error status will trigger a completely new path inside
close_ctree(), calling btrfs_error_commit_super() which flush and wait
for all ordered extents.

That btrfs_error_commit_super() will generate new delayed iputs
asynchronously, thus trigger the later ASSERT().

The first patch is to fix the error, at least I can no longer trigger
the ASSERT() in generic/475.

The second patch is to add an extra WARN_ON_ONCE() inside
btrfs_add_delayed_iput(), triggered if close_ctree() has processed after
btrfs_error_commit_super() calls.

Qu Wenruo (2):
  btrfs: run btrfs_error_commit_super() early
  btrfs: add extra warning if delayed iput is added when it's not
    allowed

 fs/btrfs/disk-io.c | 14 +++++++++++---
 fs/btrfs/fs.h      |  4 ++++
 fs/btrfs/inode.c   |  4 ++++
 3 files changed, 19 insertions(+), 3 deletions(-)

-- 
2.48.1


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

end of thread, other threads:[~2025-03-07 21:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-07  4:26 [PATCH 0/2] btrfs: fix the delayed iputs ASSERT() when the fs Qu Wenruo
2025-03-07  4:26 ` [PATCH 1/2] btrfs: run btrfs_error_commit_super() early Qu Wenruo
2025-03-07 11:36   ` Filipe Manana
2025-03-07  4:26 ` [PATCH 2/2] btrfs: add extra warning if delayed iput is added when it's not allowed Qu Wenruo
2025-03-07 11:45   ` Filipe Manana
2025-03-07 21:27     ` Qu Wenruo

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