]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: move and comment read-only check in btrfs_cancel_balance
authorDavid Sterba <dsterba@suse.com>
Wed, 21 Mar 2018 00:45:32 +0000 (01:45 +0100)
committerDavid Sterba <dsterba@suse.com>
Mon, 28 May 2018 16:07:26 +0000 (18:07 +0200)
commit23828450dfbccfdb04f7da3064354d1b254c306d
treeef8d12d7c944256074ea06fb7b8a8fd68ec87963
parent2a390df3681f5a1bcd38ff6492e61a61d25fe046
btrfs: move and comment read-only check in btrfs_cancel_balance

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: Anand Jain <anand.jain@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/volumes.c