Instead of duplicating the dropping of a log tree in case we jump to the
'error' label, move the dropping under the 'error' label and get rid of the
the unnecessary setting of the log root to NULL since we return immediately
after.
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
ret = PTR_ERR(wc.root);
wc.root = NULL;
if (ret != -ENOENT) {
- btrfs_put_root(wc.log);
- wc.log = NULL;
btrfs_abort_transaction(trans, ret);
goto error;
}
*/
ret = btrfs_pin_extent_for_log_replay(trans, wc.log->node);
if (ret) {
- btrfs_put_root(wc.log);
- wc.log = NULL;
btrfs_abort_transaction(trans, ret);
goto error;
}
error:
if (wc.trans)
btrfs_end_transaction(wc.trans);
+ btrfs_put_root(wc.log);
clear_bit(BTRFS_FS_LOG_RECOVERING, &fs_info->flags);
btrfs_free_path(path);
return ret;