• Boris Burkov's avatar
    btrfs: clear free space tree on ro->rw remount · 8b228324
    Boris Burkov authored
    A user might want to revert to v1 or nospace_cache on a root filesystem,
    and much like turning on the free space tree, that can only be done
    remounting from ro->rw. Support clearing the free space tree on such
    mounts by moving it into the shared remount logic.
    
    Since the CLEAR_CACHE option sticks around across remounts, this change
    would result in clearing the tree for ever on every remount, which is
    not desirable. To fix that, add CLEAR_CACHE to the oneshot options we
    clear at mount end, which has the other bonus of not cluttering the
    /proc/mounts output with clear_cache.
    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>
    8b228324
disk-io.c 132 KB