From: Miao Xie Date: Mon, 13 May 2013 13:55:11 +0000 (+0000) Subject: Btrfs: don't steal the reserved space from the global reserve if their space type... X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5881cfc924c8143dbc3e1f343516fc6527eb8311;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git 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 Signed-off-by: Miao Xie Signed-off-by: Josef Bacik --- 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: return block_rsv; /* * If we couldn't reserve metadata bytes try and use some from - * the global reserve. + * the global reserve if its space type is the same as the global + * reservation. */ - if (block_rsv->type != BTRFS_BLOCK_RSV_GLOBAL) { + if (block_rsv->type != BTRFS_BLOCK_RSV_GLOBAL && + block_rsv->space_info == global_rsv->space_info) { ret = block_rsv_use_bytes(global_rsv, blocksize); if (!ret) return global_rsv;