[Btrfs-devel][PATCH]Fix buffer get/release issue in create_snapshot

Yan Zheng yanzheng at 21cn.com
Tue Dec 4 05:39:16 PST 2007


Sorry, there is a typo in previous patch.

---
diff -r 66ea50b1a761 inode.c
--- a/inode.c	Tue Nov 20 13:44:45 2007 -0500
+++ b/inode.c	Tue Dec 04 21:38:06 2007 +0800
@@ -2035,7 +2035,9 @@ static int create_snapshot(struct btrfs_
 	key.offset = 1;
 	btrfs_set_key_type(&key, BTRFS_ROOT_ITEM_KEY);

+	extent_buffer_get(root->node);
 	btrfs_cow_block(trans, root, root->node, NULL, 0, &tmp);
+	free_extent_buffer(tmp);
 	btrfs_set_root_bytenr(&new_root_item, root->node->start);
 	btrfs_set_root_level(&new_root_item, btrfs_header_level(root->node));



More information about the Btrfs-devel mailing list