diff options
author | Liu Bo <bo.li.liu@oracle.com> | 2013-12-29 21:44:50 +0800 |
---|---|---|
committer | Chris Mason <clm@fb.com> | 2014-01-28 13:20:14 -0800 |
commit | 17504584f52af944960f1ad16752aa10a0755b3b (patch) | |
tree | 7428bce96d72e51705d9154b661e86a56236c7ac /fs | |
parent | 1708cc5723cb775703b42a0ce8e521019c42dd67 (diff) | |
download | linux-17504584f52af944960f1ad16752aa10a0755b3b.tar.bz2 |
Btrfs: return free space to global_rsv as much as possible
@full is not protected within global_rsv.lock, so we may think global_rsv
is already full but in fact it's not, so we miss the opportunity to return
free space to global_rsv directly when we release other block_rsvs.
Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/btrfs/extent-tree.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 3d19dcc553aa..41fe80b9db47 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -4674,7 +4674,7 @@ void btrfs_block_rsv_release(struct btrfs_root *root, u64 num_bytes) { struct btrfs_block_rsv *global_rsv = &root->fs_info->global_block_rsv; - if (global_rsv->full || global_rsv == block_rsv || + if (global_rsv == block_rsv || block_rsv->space_info != global_rsv->space_info) global_rsv = NULL; block_rsv_release_bytes(root->fs_info, block_rsv, global_rsv, |