diff options
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r-- | fs/btrfs/extent-tree.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 3cde907a25a5..ec0328bb86db 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c | |||
@@ -3961,7 +3961,10 @@ static struct btrfs_block_rsv *get_block_rsv( | |||
3961 | { | 3961 | { |
3962 | struct btrfs_block_rsv *block_rsv = NULL; | 3962 | struct btrfs_block_rsv *block_rsv = NULL; |
3963 | 3963 | ||
3964 | if (root->ref_cows || root == root->fs_info->csum_root) | 3964 | if (root->ref_cows) |
3965 | block_rsv = trans->block_rsv; | ||
3966 | |||
3967 | if (root == root->fs_info->csum_root && trans->adding_csums) | ||
3965 | block_rsv = trans->block_rsv; | 3968 | block_rsv = trans->block_rsv; |
3966 | 3969 | ||
3967 | if (!block_rsv) | 3970 | if (!block_rsv) |
@@ -4313,6 +4316,9 @@ static void release_global_block_rsv(struct btrfs_fs_info *fs_info) | |||
4313 | void btrfs_trans_release_metadata(struct btrfs_trans_handle *trans, | 4316 | void btrfs_trans_release_metadata(struct btrfs_trans_handle *trans, |
4314 | struct btrfs_root *root) | 4317 | struct btrfs_root *root) |
4315 | { | 4318 | { |
4319 | if (!trans->block_rsv) | ||
4320 | return; | ||
4321 | |||
4316 | if (!trans->bytes_reserved) | 4322 | if (!trans->bytes_reserved) |
4317 | return; | 4323 | return; |
4318 | 4324 | ||