aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/btrfs/disk-io.c2
-rw-r--r--fs/btrfs/extent-tree.c11
2 files changed, 8 insertions, 5 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 997cc578a185..c9201ec81fef 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -167,7 +167,7 @@ int commit_transaction(struct ctree_root *root, struct ctree_super_block *s)
167 root->node->count++; 167 root->node->count++;
168 ret = btrfs_drop_snapshot(root, snap); 168 ret = btrfs_drop_snapshot(root, snap);
169 BUG_ON(ret); 169 BUG_ON(ret);
170 tree_block_release(root, snap); 170 // tree_block_release(root, snap);
171 } 171 }
172 write_ctree_super(root, s); 172 write_ctree_super(root, s);
173 btrfs_finish_extent_commit(root); 173 btrfs_finish_extent_commit(root);
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 6fbaece43ff6..e7b8a70b5e52 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -441,15 +441,15 @@ int walk_down_tree(struct ctree_root *root, struct ctree_path *path, int *level)
441 } 441 }
442 BUG_ON(ret); 442 BUG_ON(ret);
443 next = read_tree_block(root, blocknr); 443 next = read_tree_block(root, blocknr);
444 if (path->nodes[*level-1]) { 444 if (path->nodes[*level-1])
445 tree_block_release(root, path->nodes[*level-1]); 445 tree_block_release(root, path->nodes[*level-1]);
446 }
447 path->nodes[*level-1] = next; 446 path->nodes[*level-1] = next;
448 *level = node_level(next->node.header.flags); 447 *level = node_level(next->node.header.flags);
449 path->slots[*level] = 0; 448 path->slots[*level] = 0;
450 } 449 }
451out: 450out:
452 ret = free_extent(root, path->nodes[*level]->blocknr, 1); 451 ret = free_extent(root, path->nodes[*level]->blocknr, 1);
452 tree_block_release(root, path->nodes[*level]);
453 path->nodes[*level] = NULL; 453 path->nodes[*level] = NULL;
454 *level += 1; 454 *level += 1;
455 BUG_ON(ret); 455 BUG_ON(ret);
@@ -470,6 +470,8 @@ int walk_up_tree(struct ctree_root *root, struct ctree_path *path, int *level)
470 } else { 470 } else {
471 ret = free_extent(root, 471 ret = free_extent(root,
472 path->nodes[*level]->blocknr, 1); 472 path->nodes[*level]->blocknr, 1);
473 tree_block_release(root, path->nodes[*level]);
474 path->nodes[*level] = NULL;
473 *level = i + 1; 475 *level = i + 1;
474 BUG_ON(ret); 476 BUG_ON(ret);
475 } 477 }
@@ -499,9 +501,10 @@ int btrfs_drop_snapshot(struct ctree_root *root, struct tree_buffer *snap)
499 if (ret > 0) 501 if (ret > 0)
500 break; 502 break;
501 } 503 }
502 for (i = 0; i < orig_level; i++) { 504 for (i = 0; i <= orig_level; i++) {
503 if (path.nodes[i]) 505 if (path.nodes[i]) {
504 tree_block_release(root, path.nodes[i]); 506 tree_block_release(root, path.nodes[i]);
507 }
505 } 508 }
506 509
507 return 0; 510 return 0;