[PATCH RFC 6/8] btrfs: use super write guard in relocating_repair_kthread()

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

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

diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 4152b0a5537a..37b9daa14445 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -8178,7 +8178,8 @@ static int relocating_repair_kthread(void *data)
target = cache->start;
btrfs_put_block_group(cache);

- sb_start_write(fs_info->sb);
+ guard(super_write)(fs_info->sb);
+
if (!btrfs_exclop_start(fs_info, BTRFS_EXCLOP_BALANCE)) {
btrfs_info(fs_info,
"zoned: skip relocating block group %llu to repair: EBUSY",
@@ -8211,7 +8212,6 @@ static int relocating_repair_kthread(void *data)
btrfs_put_block_group(cache);
mutex_unlock(&fs_info->reclaim_bgs_lock);
btrfs_exclop_finish(fs_info);
- sb_end_write(fs_info->sb);

return ret;
}

--
2.47.3