Skip to content

btrfs: fix the delayed iputs ASSERT() when the fs

Qu Wenruo linux-btrfs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2btrfs: run btrfs_error_commit_super() earlyfs/btrfs/disk-io.c+8 -31 reply
2/2btrfs: add extra warning if delayed iput is added when it's not allowedfs/btrfs/disk-io.c fs/btrfs/fs.h fs/btrfs/inode.c+11 -02 replies

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchFilipe Manana
1/2R-b
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/2] btrfs: fix the delayed iputs ASSERT() when the fs

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(-)
Signature · 1 line
2.48.1