[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-btrfs
Subject:    Re: [PATCH v7 09/12] btrfs: warn when remount will not change the free space tree
From:       David Sterba <dsterba () suse ! cz>
Date:       2020-11-30 20:05:17
Message-ID: 20201130200517.GJ6430 () twin ! jikos ! cz
[Download RAW message or body]

On Wed, Nov 18, 2020 at 03:06:24PM -0800, Boris Burkov wrote:
> If the remount is ro->ro, rw->ro, or rw->rw, we will not create or
> clear the free space tree. This can be surprising, so print a warning
> to dmesg to make the failure more visible. It is also important to
> ensure that the space cache options (SPACE_CACHE, FREE_SPACE_TREE) are
> consistent, so ensure those are set to properly match the current on
> disk state (which won't be changing).
> 
> Signed-off-by: Boris Burkov <boris@bur.io>
> ---
>  fs/btrfs/super.c | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
> 
> diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
> index e2a186d254c5..5e88ae69e2e6 100644
> --- a/fs/btrfs/super.c
> +++ b/fs/btrfs/super.c
> @@ -1912,6 +1912,24 @@ static int btrfs_remount(struct super_block *sb, int *flags, char *data)
>  	btrfs_resize_thread_pool(fs_info,
>  		fs_info->thread_pool_size, old_thread_pool_size);
>  
> +	if (btrfs_test_opt(fs_info, FREE_SPACE_TREE) !=
> +	    btrfs_fs_compat_ro(fs_info, FREE_SPACE_TREE) &&
> +	    ((!sb_rdonly(sb) || *flags & SB_RDONLY))) {

	(!sb_rdonly(sb) || (*flags & SB_RDONLY))) {

Ie. the parens around the & operator, not (( )) around the whole
expression.
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic