]> git.hungrycats.org Git - linux/commit
btrfs: avoid long stall when dropping a non-shared large subvolume
authorQu Wenruo <wqu@suse.com>
Thu, 27 Aug 2026 06:55:30 +0000 (16:25 +0930)
committerDavid Sterba <dsterba@suse.com>
Mon, 14 Sep 2026 11:23:36 +0000 (13:23 +0200)
commitddfce12cf94208160df06449025a6e847c2ea8f6
tree57ff29acef61a3f0ee2aa745a42bf3dfa405d361
parent1d7404d4daeacbebe5a75f812dd6e45e3340d340
btrfs: avoid long stall when dropping a non-shared large subvolume

Commit 011b46c30476 ("btrfs: skip subtree scan if it's too high to avoid
low stall in btrfs_commit_transaction()") introduced a mechanism to skip
large subtree during snapshot dropping.

But even for a subvolume without any shared tree blocks, we can still
queue quite a lot of qgroup records into one transaction, and cause a
long qgroup related stall.

So also add a check against the subvolume root level, to determine if we
need to mark qgroup inconsistent.

Reviewed-by: Boris Burkov <boris@bur.io>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent-tree.c
fs/btrfs/qgroup.c
fs/btrfs/qgroup.h