summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent-tree.c
diff options
context:
space:
mode:
authorMiao Xie <miaox@cn.fujitsu.com>2012-09-06 04:03:56 -0600
committerChris Mason <chris.mason@fusionio.com>2012-10-01 15:19:12 -0400
commit48c03c4bcfd7a1fcb1e05e9b1db1188cdbecf49a (patch)
treeaa89a228922632062ce60e18719e1be0bdb4475a /fs/btrfs/extent-tree.c
parent42874b3db7817f662b1d7c6e32f8b63638fa0321 (diff)
downloadblackbird-op-linux-48c03c4bcfd7a1fcb1e05e9b1db1188cdbecf49a.tar.gz
blackbird-op-linux-48c03c4bcfd7a1fcb1e05e9b1db1188cdbecf49a.zip
Btrfs: fix wrong size for the reservation of the, snapshot creation
We should insert/update 6 items(root ref, root backref, dir item, dir index, root item and parent inode) when creating a snapshot, not 5 items, fix it. Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r--fs/btrfs/extent-tree.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 36e03312267a..b6b33e463ac3 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -4414,10 +4414,10 @@ int btrfs_snap_reserve_metadata(struct btrfs_trans_handle *trans,
struct btrfs_block_rsv *src_rsv = get_block_rsv(trans, root);
struct btrfs_block_rsv *dst_rsv = &pending->block_rsv;
/*
- * two for root back/forward refs, two for directory entries
- * and one for root of the snapshot.
+ * two for root back/forward refs, two for directory entries,
+ * one for root of the snapshot and one for parent inode.
*/
- u64 num_bytes = btrfs_calc_trans_metadata_size(root, 5);
+ u64 num_bytes = btrfs_calc_trans_metadata_size(root, 6);
dst_rsv->space_info = src_rsv->space_info;
return block_rsv_migrate_bytes(src_rsv, dst_rsv, num_bytes);
}
OpenPOWER on IntegriCloud