[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <247c8075-60d3-4090-a76d-8d59d9e859ca@suse.com>
Date: Wed, 5 Nov 2025 07:12:38 +1030
From: Qu Wenruo <wqu@...e.com>
To: Christian Brauner <brauner@...nel.org>, linux-fsdevel@...r.kernel.org
Cc: Alexander Viro <viro@...iv.linux.org.uk>, Jan Kara <jack@...e.cz>,
linux-btrfs@...r.kernel.org, linux-ext4@...r.kernel.org,
linux-xfs@...r.kernel.org
Subject: Re: [PATCH RFC 2/8] btrfs: use super write guard in
btrfs_reclaim_bgs_work()
在 2025/11/4 22:42, Christian Brauner 写道:
> Signed-off-by: Christian Brauner <brauner@...nel.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);
This one is still left using the old scheme, and there is another one in
the mutex_trylock() branch.
I'm wondering how safe is the new scope based auto freeing.
Like when the freeing function is called? Will it break the existing
freeing/locking sequence in other locations?
For this call site, sb_end_write() is always called last so it's fine.
Thanks,
Qu
> @@ -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)
>
Powered by blists - more mailing lists