Commit c6414280 authored by Liu Bo's avatar Liu Bo Committed by David Sterba

btrfs: free path at an earlier point in btrfs_get_extent

trace_btrfs_get_extent() has nothing to do with path, place
btrfs_free_path ahead so that we can unlock path on error.
Signed-off-by: default avatarLiu Bo <bo.liu@linux.alibaba.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 9688e9a9
...@@ -6979,10 +6979,10 @@ struct extent_map *btrfs_get_extent(struct btrfs_inode *inode, ...@@ -6979,10 +6979,10 @@ struct extent_map *btrfs_get_extent(struct btrfs_inode *inode,
err = btrfs_add_extent_mapping(fs_info, em_tree, &em, start, len); err = btrfs_add_extent_mapping(fs_info, em_tree, &em, start, len);
write_unlock(&em_tree->lock); write_unlock(&em_tree->lock);
out: out:
btrfs_free_path(path);
trace_btrfs_get_extent(root, inode, em); trace_btrfs_get_extent(root, inode, em);
btrfs_free_path(path);
if (err) { if (err) {
free_extent_map(em); free_extent_map(em);
return ERR_PTR(err); return ERR_PTR(err);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment