diff options
| author | Qu Wenruo <wqu@suse.com> | 2026-10-13 16:11:19 +1030 |
|---|---|---|
| committer | David Sterba <dsterba@suse.com> | 2026-10-30 23:14:22 +0100 |
| commit | 27f3c7c53e6d87ccb327dc439a604d14f8a04aef (patch) | |
| tree | 6e19dd6edac97d6b070507e56d3c50a2e7e7d43e /scripts | |
| parent | 7d69a15748fe37f2cb5720cb4842bfaf0e3642dc (diff) | |
btrfs: cleanup qgroup swapped blocks at root release
Normally btrfs_qgroup_clean_swapped_blocks() is called when switching
the commit root of a subvolume tree.
However if a transaction is aborted before all dirty subvolumes are
linked to switch_commits, those left-over dirty subvolumes won't get
their qgroup swapped blocks cleaned up.
And since a transaction is already aborted, no new transaction is
allowed to be started, thus no way to cleanup the qgroup swapped blocks
for those subvolume trees.
Fix the problem by calling btrfs_qgroup_clean_swapped_blocks() inside
btrfs_put_root() when the last ref is dropped, so that at unmount time
those left-over qgroup swapped blocks are properly released.
This fix is inspired by the recent Sashiko reports about similar cases
on cowonly roots.
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'scripts')
0 files changed, 0 insertions, 0 deletions
