Skip to content

Commit

Permalink
btrfs: free path at an earlier point in btrfs_get_extent
Browse files Browse the repository at this point in the history
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: Liu Bo <[email protected]>
Reviewed-by: David Sterba <[email protected]>
Signed-off-by: David Sterba <[email protected]>
  • Loading branch information
liubogithub authored and kdave committed Oct 15, 2018
1 parent 9688e9a commit c641428
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/btrfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
write_unlock(&em_tree->lock);
out:
btrfs_free_path(path);

trace_btrfs_get_extent(root, inode, em);

btrfs_free_path(path);
if (err) {
free_extent_map(em);
return ERR_PTR(err);
Expand Down

0 comments on commit c641428

Please sign in to comment.