* [PATCH] Btrfs: btrfs_get_extent: put btrfs_free_path ahead
@ 2018-08-22 23:36 Liu Bo
2018-08-24 12:19 ` David Sterba
0 siblings, 1 reply; 2+ messages in thread
From: Liu Bo @ 2018-08-22 23:36 UTC (permalink / raw)
To: linux-btrfs
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 <bo.liu@linux.alibaba.com>
---
fs/btrfs/inode.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 31d43355f052..6a0380f3f318 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -7000,10 +7000,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);
--
1.8.3.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-08-24 15:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-22 23:36 [PATCH] Btrfs: btrfs_get_extent: put btrfs_free_path ahead Liu Bo
2018-08-24 12:19 ` David Sterba
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).