]> git.ipfire.org Git - people/ms/linux.git/commit - fs/btrfs/ioctl.c
btrfs: track running balance in a simpler way
authorDavid Sterba <dsterba@suse.com>
Wed, 21 Mar 2018 00:31:04 +0000 (01:31 +0100)
committerDavid Sterba <dsterba@suse.com>
Mon, 28 May 2018 16:07:25 +0000 (18:07 +0200)
commit3009a62f3b18230a000d1a91e9a676036487e834
tree87182c14f50c753c4b408b103c7bdc2215ac84c3
parentdccdb07bc996e9c8de80d06813163ca08288bf73
btrfs: track running balance in a simpler way

Currently fs_info::balance_running is 0 or 1 and does not use the
semantics of atomics. The pause and cancel check for 0, that can happen
only after __btrfs_balance exits for whatever reason.

Parallel calls to balance ioctl may enter btrfs_ioctl_balance multiple
times but will block on the balance_mutex that protects the
fs_info::flags bit.

Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ctree.h
fs/btrfs/disk-io.c
fs/btrfs/ioctl.c
fs/btrfs/volumes.c