Commit 2732798c authored by Josef Bacik's avatar Josef Bacik Committed by David Sterba

btrfs: call btrfs_try_granting_tickets when unpinning anything

When unpinning we were only calling btrfs_try_granting_tickets() if
global_rsv->space_info == space_info, which is problematic because we
use ticketing for SYSTEM chunks, and want to use it for DATA as well.
Fix this by moving this call outside of that if statement.
Reviewed-by: default avatarNikolay Borisov <nborisov@suse.com>
Reviewed-by: default avatarJohannes Thumshirn <johannes.thumshirn@wdc.com>
Tested-by: default avatarNikolay Borisov <nborisov@suse.com>
Signed-off-by: default avatarJosef Bacik <josef@toxicpanda.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 3308234a
...@@ -2849,11 +2849,10 @@ static int unpin_extent_range(struct btrfs_fs_info *fs_info, ...@@ -2849,11 +2849,10 @@ static int unpin_extent_range(struct btrfs_fs_info *fs_info,
len -= to_add; len -= to_add;
} }
spin_unlock(&global_rsv->lock); spin_unlock(&global_rsv->lock);
/* Add to any tickets we may have */
if (len)
btrfs_try_granting_tickets(fs_info,
space_info);
} }
/* Add to any tickets we may have */
if (!readonly && return_free_space && len)
btrfs_try_granting_tickets(fs_info, space_info);
spin_unlock(&space_info->lock); spin_unlock(&space_info->lock);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment