Re: [PATCH v3 1/4] btrfs: support remount of ro fs with free space tree

Josef Bacik
2020-09-21T14:35:37Z

On 9/17/20 2:13 PM, Boris Burkov wrote:
> When a user attempts to remount a btrfs filesystem with
> 'mount -o remount,space_cache=v2', that operation silently succeeds.
> Unfortunately, this is misleading, because the remount does not create
> the free space tree. /proc/mounts will incorrectly show space_cache=v2,
> but on the next mount, the file system will revert to the old
> space_cache.
>
> For now, we handle only the easier case, where the existing mount is
> read-only and the new mount is read-write. In that case, we can create
> the free space tree without contending with the block groups changing
> as we go. If the remount is ro->ro, rw->ro, or rw->rw, we will not
> create the free space tree, and print a warning to dmesg so that this
> failure is more visible.
>
> References: https://github.com/btrfs/btrfs-todo/issues/5
> Signed-off-by: Boris Burkov <boris@bur.io>

Reviewed-by: Josef Bacik <josef@toxicpanda.com>

Thanks,

Josef