diff options
author | Josef Bacik <[email protected]> | 2020-07-21 10:22:18 -0400 |
---|---|---|
committer | David Sterba <[email protected]> | 2020-10-07 12:06:51 +0200 |
commit | 2732798c9bb647978043e4daf54a6f9f3025d4c5 (patch) | |
tree | 7992543f9c774d2c9aef80734664c459c497b4ae | |
parent | 3308234a7e9828f8cbec308010348ddf712fc15e (diff) |
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: Nikolay Borisov <[email protected]>
Reviewed-by: Johannes Thumshirn <[email protected]>
Tested-by: Nikolay Borisov <[email protected]>
Signed-off-by: Josef Bacik <[email protected]>
Reviewed-by: David Sterba <[email protected]>
Signed-off-by: David Sterba <[email protected]>
-rw-r--r-- | fs/btrfs/extent-tree.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index dbff61d36cab..79c4432e6a3f 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -2849,11 +2849,10 @@ static int unpin_extent_range(struct btrfs_fs_info *fs_info, len -= to_add; } 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); } |