summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/inode.c
diff options
context:
space:
mode:
authorMiao Xie <miaox@cn.fujitsu.com>2013-03-28 09:08:20 +0100
committerJosef Bacik <jbacik@fusionio.com>2013-03-28 14:51:30 +0100
commit39847c4d3d91f487f9ab3d083ee5d0f8419f105c (patch)
tree9de238dbe4fbe627d4b8914561827cf6b3d9c19e /fs/btrfs/inode.c
parentBtrfs: fix double free in the btrfs_qgroup_account_ref() (diff)
downloadlinux-39847c4d3d91f487f9ab3d083ee5d0f8419f105c.tar.xz
linux-39847c4d3d91f487f9ab3d083ee5d0f8419f105c.zip
Btrfs: fix wrong reservation of csums
We reserve the space for csums only when we write data into a file, in the other cases, such as tree log, log replay, we don't do reservation, so we can use the reservation of the transaction handle just for the former. And for the latter, we should use the tree's own reservation. But the function - btrfs_csum_file_blocks() didn't differentiate between these two types of the cases, fix it. Signed-off-by: Miao Xie <miaox@cn.fujitsu.com> Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Diffstat (limited to '')
-rw-r--r--fs/btrfs/inode.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 8cab424c75f8..b88381582dab 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -1757,8 +1757,10 @@ static noinline int add_pending_csums(struct btrfs_trans_handle *trans,
struct btrfs_ordered_sum *sum;
list_for_each_entry(sum, list, list) {
+ trans->adding_csums = 1;
btrfs_csum_file_blocks(trans,
BTRFS_I(inode)->root->fs_info->csum_root, sum);
+ trans->adding_csums = 0;
}
return 0;
}