[PATCH] btrfs: Fix race condition between delayed refs and blockgroup removal

2018-04-11 Thread Nikolay Borisov
When the delayed refs for a head are all run, eventually cleanup_ref_head is called which (in case of deletion) obtains a reference for the relevant btrfs_space_info struct by querying the bg for the range. This is problematic because when the last extent of a bg is deleted a race window emerges be

Re: [PATCH] btrfs: Fix race condition between delayed refs and blockgroup removal

2018-04-11 Thread Omar Sandoval
On Wed, Apr 11, 2018 at 10:04:49AM +0300, Nikolay Borisov wrote: > When the delayed refs for a head are all run, eventually > cleanup_ref_head is called which (in case of deletion) obtains a > reference for the relevant btrfs_space_info struct by querying the bg > for the range. This is problematic

Re: [PATCH] btrfs: Fix race condition between delayed refs and blockgroup removal

2018-04-11 Thread Nikolay Borisov
On 11.04.2018 10:09, Omar Sandoval wrote: > On Wed, Apr 11, 2018 at 10:04:49AM +0300, Nikolay Borisov wrote: >> When the delayed refs for a head are all run, eventually >> cleanup_ref_head is called which (in case of deletion) obtains a >> reference for the relevant btrfs_space_info struct by que