• Boris Burkov's avatar
    btrfs: create free space tree on ro->rw remount · 5011139a
    Boris Burkov authored
    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.
    Reviewed-by: default avatarJosef Bacik <josef@toxicpanda.com>
    Signed-off-by: default avatarBoris Burkov <boris@bur.io>
    Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    5011139a
disk-io.c 132 KB