public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Qu Wenruo <wqu@suse.com>
To: linux-btrfs@vger.kernel.org
Cc: fdmanana@kernel.org
Subject: [PATCH 0/2] btrfs: fix the delayed iputs ASSERT() when the fs
Date: Fri,  7 Mar 2025 14:56:35 +1030	[thread overview]
Message-ID: <cover.1741321288.git.wqu@suse.com> (raw)

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


             reply	other threads:[~2025-03-07  4:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-07  4:26 Qu Wenruo [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1741321288.git.wqu@suse.com \
    --to=wqu@suse.com \
    --cc=fdmanana@kernel.org \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox