diff options
author | Liu Bo <bo.li.liu@oracle.com> | 2013-09-28 22:33:16 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@fusionio.com> | 2013-11-11 21:54:48 -0500 |
commit | 7d3d1744f8a7d62e4875bd69cc2192a939813880 (patch) | |
tree | 31314caac540d4eaf13a7a4305d6a71f20957114 /fs/btrfs/volumes.c | |
parent | fa7c14947abea7b30f661d902c9a515056be6d90 (diff) |
Btrfs: fix memory leak of chunks' extent map
As we're hold a ref on looking up the extent map, we need to drop the ref
before returning to callers.
Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'fs/btrfs/volumes.c')
-rw-r--r-- | fs/btrfs/volumes.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 043b215769c2..b691f375d837 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c | |||
@@ -4488,6 +4488,7 @@ int btrfs_num_copies(struct btrfs_fs_info *fs_info, u64 logical, u64 len) | |||
4488 | btrfs_crit(fs_info, "Invalid mapping for %Lu-%Lu, got " | 4488 | btrfs_crit(fs_info, "Invalid mapping for %Lu-%Lu, got " |
4489 | "%Lu-%Lu\n", logical, logical+len, em->start, | 4489 | "%Lu-%Lu\n", logical, logical+len, em->start, |
4490 | em->start + em->len); | 4490 | em->start + em->len); |
4491 | free_extent_map(em); | ||
4491 | return 1; | 4492 | return 1; |
4492 | } | 4493 | } |
4493 | 4494 | ||
@@ -4668,6 +4669,7 @@ static int __btrfs_map_block(struct btrfs_fs_info *fs_info, int rw, | |||
4668 | btrfs_crit(fs_info, "found a bad mapping, wanted %Lu, " | 4669 | btrfs_crit(fs_info, "found a bad mapping, wanted %Lu, " |
4669 | "found %Lu-%Lu\n", logical, em->start, | 4670 | "found %Lu-%Lu\n", logical, em->start, |
4670 | em->start + em->len); | 4671 | em->start + em->len); |
4672 | free_extent_map(em); | ||
4671 | return -EINVAL; | 4673 | return -EINVAL; |
4672 | } | 4674 | } |
4673 | 4675 | ||