aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/tree-log.c
diff options
context:
space:
mode:
authorJosef Bacik <jbacik@fusionio.com>2013-04-24 16:40:05 -0400
committerJosef Bacik <jbacik@fusionio.com>2013-05-06 15:55:10 -0400
commitabefa55ac1f8cb8fb8cb4d7e8d619dc0859181ab (patch)
tree7d5a5e7d51ad174efbaf46559e14a9eb8bd21cce /fs/btrfs/tree-log.c
parent32b0253803bf8e384a37a70f2dfffb2056e7d087 (diff)
Btrfs: check return value of commit when recovering log
We need to check the return value of the commit in case something goes wrong, otherwise we could end up going down the line and doing more stuff (like orphan cleanup) before we notice we should have errored out. We need to do this before we free up the log_tree_root since the caller will handle all of that. Thanks, Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Diffstat (limited to 'fs/btrfs/tree-log.c')
-rw-r--r--fs/btrfs/tree-log.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
index 1fdc221a9c0b..f50137a98fb1 100644
--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
@@ -4012,16 +4012,17 @@ again:
4012 4012
4013 btrfs_free_path(path); 4013 btrfs_free_path(path);
4014 4014
4015 /* step 4: commit the transaction, which also unpins the blocks */
4016 ret = btrfs_commit_transaction(trans, fs_info->tree_root);
4017 if (ret)
4018 return ret;
4019
4015 free_extent_buffer(log_root_tree->node); 4020 free_extent_buffer(log_root_tree->node);
4016 log_root_tree->log_root = NULL; 4021 log_root_tree->log_root = NULL;
4017 fs_info->log_root_recovering = 0; 4022 fs_info->log_root_recovering = 0;
4018
4019 /* step 4: commit the transaction, which also unpins the blocks */
4020 btrfs_commit_transaction(trans, fs_info->tree_root);
4021
4022 kfree(log_root_tree); 4023 kfree(log_root_tree);
4023 return 0;
4024 4024
4025 return 0;
4025error: 4026error:
4026 btrfs_free_path(path); 4027 btrfs_free_path(path);
4027 return ret; 4028 return ret;