[PATCH RFC 2/8] btrfs: use super write guard in btrfs_reclaim_bgs_work()

Christian Brauner
2025-11-04T12:12:42Z

Signed-off-by: Christian Brauner <brauner@kernel.org>
---
fs/btrfs/block-group.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/btrfs/block-group.c b/fs/btrfs/block-group.c
index 5322ef2ae015..8284b9435758 100644
--- a/fs/btrfs/block-group.c
+++ b/fs/btrfs/block-group.c
@@ -1850,7 +1850,7 @@ void btrfs_reclaim_bgs_work(struct work_struct *work)
if (!btrfs_should_reclaim(fs_info))
return;

- sb_start_write(fs_info->sb);
+ guard(super_write)(fs_info->sb);

if (!btrfs_exclop_start(fs_info, BTRFS_EXCLOP_BALANCE)) {
sb_end_write(fs_info->sb);
@@ -2030,7 +2030,6 @@ void btrfs_reclaim_bgs_work(struct work_struct *work)
list_splice_tail(&retry_list, &fs_info->reclaim_bgs);
spin_unlock(&fs_info->unused_bgs_lock);
btrfs_exclop_finish(fs_info);
- sb_end_write(fs_info->sb);
}

void btrfs_reclaim_bgs(struct btrfs_fs_info *fs_info)

--
2.47.3