]> 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)
commit496e0a0400f55b46ff4f1ce9a72359d03762c285
treeef8d12d7c944256074ea06fb7b8a8fd68ec87963
parent72252b4ac172b00243b5d8669ae04137e48ded84
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