diff options
author | Chris Mason <chris.mason@oracle.com> | 2007-10-15 16:14:48 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-09-25 11:03:56 -0400 |
commit | f510cfecfc98759d75283823cfccf0cc0d59a4c6 (patch) | |
tree | dfc2f788df4e2a437d976f78a2a2a675375f7134 /fs/btrfs/transaction.c | |
parent | ae5252bd51a252b7b8b02289337c36774835101c (diff) |
Btrfs: Fix extent_buffer and extent_state leaks
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/transaction.c')
-rw-r--r-- | fs/btrfs/transaction.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index 750f35a37aae..372b61f5733f 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c | |||
@@ -352,7 +352,7 @@ int btrfs_defrag_root(struct btrfs_root *root, int cacheonly) | |||
352 | return 0; | 352 | return 0; |
353 | 353 | ||
354 | trans = btrfs_start_transaction(root, 1); | 354 | trans = btrfs_start_transaction(root, 1); |
355 | while (1) { | 355 | while (0) { |
356 | root->defrag_running = 1; | 356 | root->defrag_running = 1; |
357 | ret = btrfs_defrag_leaves(trans, root, cacheonly); | 357 | ret = btrfs_defrag_leaves(trans, root, cacheonly); |
358 | nr = trans->blocks_used; | 358 | nr = trans->blocks_used; |
@@ -394,7 +394,7 @@ int btrfs_defrag_dirty_roots(struct btrfs_fs_info *info) | |||
394 | for (i = 0; i < ret; i++) { | 394 | for (i = 0; i < ret; i++) { |
395 | root = gang[i]; | 395 | root = gang[i]; |
396 | last = root->root_key.objectid + 1; | 396 | last = root->root_key.objectid + 1; |
397 | // btrfs_defrag_root(root, 1); | 397 | btrfs_defrag_root(root, 1); |
398 | } | 398 | } |
399 | } | 399 | } |
400 | // btrfs_defrag_root(info->extent_root, 1); | 400 | // btrfs_defrag_root(info->extent_root, 1); |
@@ -462,6 +462,7 @@ static int drop_dirty_roots(struct btrfs_root *tree_root, | |||
462 | ret = btrfs_end_transaction(trans, tree_root); | 462 | ret = btrfs_end_transaction(trans, tree_root); |
463 | BUG_ON(ret); | 463 | BUG_ON(ret); |
464 | 464 | ||
465 | free_extent_buffer(dirty->root->node); | ||
465 | kfree(dirty->root); | 466 | kfree(dirty->root); |
466 | kfree(dirty); | 467 | kfree(dirty); |
467 | mutex_unlock(&tree_root->fs_info->fs_mutex); | 468 | mutex_unlock(&tree_root->fs_info->fs_mutex); |