Re: [PATCH v2 12/16] btrfs: track running balance in a simpler way

2018-04-27 Thread David Sterba
On Fri, Apr 27, 2018 at 10:10:24AM +0800, Anand Jain wrote: > > > On 04/20/2018 12:33 AM, David Sterba wrote: > > 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

Re: [PATCH v2 12/16] btrfs: track running balance in a simpler way

2018-04-26 Thread Anand Jain
On 04/20/2018 12:33 AM, David Sterba wrote: 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

Re: [PATCH v2 12/16] btrfs: track running balance in a simpler way

2018-04-20 Thread Anand Jain
Ok not that simple, the running status is checked outside of balance_mutex and there's one more assertion that does not expect the balance_ctl to exist: @@ -4031,16 +4032,16 @@ int btrfs_pause_balance(struct btrfs_fs_info *fs_info) return -ENOTCONN; } -

Re: [PATCH v2 12/16] btrfs: track running balance in a simpler way

2018-04-20 Thread David Sterba
On Fri, Apr 20, 2018 at 01:58:11PM +0200, David Sterba wrote: > On Fri, Apr 20, 2018 at 03:52:24PM +0800, Anand Jain wrote: > > > > > > On 04/20/2018 12:33 AM, David Sterba wrote: > > > Currently fs_info::balance_running is 0 or 1 and does not use the > > > semantics of atomics. The pause and

Re: [PATCH v2 12/16] btrfs: track running balance in a simpler way

2018-04-20 Thread David Sterba
On Fri, Apr 20, 2018 at 03:52:24PM +0800, Anand Jain wrote: > > > On 04/20/2018 12:33 AM, David Sterba wrote: > > 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

Re: [PATCH v2 12/16] btrfs: track running balance in a simpler way

2018-04-20 Thread Anand Jain
On 04/20/2018 12:33 AM, David Sterba wrote: 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

[PATCH v2 12/16] btrfs: track running balance in a simpler way

2018-04-19 Thread David Sterba
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