summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/disk-io.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2018-03-21 01:31:04 +0100
committerDavid Sterba <dsterba@suse.com>2018-05-28 18:07:25 +0200
commit3009a62f3b18230a000d1a91e9a676036487e834 (patch)
tree87182c14f50c753c4b408b103c7bdc2215ac84c3 /fs/btrfs/disk-io.c
parentdccdb07bc996e9c8de80d06813163ca08288bf73 (diff)
downloadtalos-obmc-linux-3009a62f3b18230a000d1a91e9a676036487e834.tar.gz
talos-obmc-linux-3009a62f3b18230a000d1a91e9a676036487e834.zip
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>
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r--fs/btrfs/disk-io.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 49a990c8493e..7503ff1dd6f0 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -2164,7 +2164,6 @@ static void btrfs_init_balance(struct btrfs_fs_info *fs_info)
{
spin_lock_init(&fs_info->balance_lock);
mutex_init(&fs_info->balance_mutex);
- atomic_set(&fs_info->balance_running, 0);
atomic_set(&fs_info->balance_pause_req, 0);
atomic_set(&fs_info->balance_cancel_req, 0);
fs_info->balance_ctl = NULL;
OpenPOWER on IntegriCloud