• David Sterba's avatar
    btrfs: move and comment read-only check in btrfs_cancel_balance · cf7d20f4
    David Sterba authored
    Balance cannot be started on a read-only filesystem and will have to
    finish/exit before eg. going to read-only via remount.
    
    In case the filesystem is forcibly set to read-only after an error,
    balance will finish anyway and if the cancel call is too fast it will
    just wait for that to happen.
    
    The last case is when the balance is paused after mount but it's
    read-only and cancelling would want to delete the item. The test is
    moved after the check if balance is running at all, as it looks more
    logical to report "no balance running" instead of "read-only
    filesystem".
    Reviewed-by: default avatarAnand Jain <anand.jain@oracle.com>
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    cf7d20f4
volumes.c 193 KB