aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs
diff options
context:
space:
mode:
authorMiao Xie <miaox@cn.fujitsu.com>2013-05-13 09:55:11 -0400
committerJosef Bacik <jbacik@fusionio.com>2013-05-17 21:40:25 -0400
commit5881cfc924c8143dbc3e1f343516fc6527eb8311 (patch)
tree9c892f0bbe0d393d2e6393a131d88498307a3691 /fs/btrfs
parentb586b32374909863311b7c916c7c0c709141e35a (diff)
Btrfs: don't steal the reserved space from the global reserve if their space type is different
If the type of the space we need is different with the global reserve, we can not steal the space from the global reserve, because we can not allocate the space from the free space cache that the global reserve points to. Cc: Tsutomu Itoh <t-itoh@jp.fujitsu.com> Signed-off-by: Miao Xie <miaox@cn.fujitsu.com> Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r--fs/btrfs/extent-tree.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 5e2c0bf84075..54e63b273a64 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -6681,9 +6681,11 @@ try_reserve:
6681 return block_rsv; 6681 return block_rsv;
6682 /* 6682 /*
6683 * If we couldn't reserve metadata bytes try and use some from 6683 * If we couldn't reserve metadata bytes try and use some from
6684 * the global reserve. 6684 * the global reserve if its space type is the same as the global
6685 * reservation.
6685 */ 6686 */
6686 if (block_rsv->type != BTRFS_BLOCK_RSV_GLOBAL) { 6687 if (block_rsv->type != BTRFS_BLOCK_RSV_GLOBAL &&
6688 block_rsv->space_info == global_rsv->space_info) {
6687 ret = block_rsv_use_bytes(global_rsv, blocksize); 6689 ret = block_rsv_use_bytes(global_rsv, blocksize);
6688 if (!ret) 6690 if (!ret)
6689 return global_rsv; 6691 return global_rsv;