diff mbox

Btrfs: fix em leak in find_first_block_group

Message ID 1471548606-1433-1-git-send-email-jbacik@fb.com (mailing list archive)
State Accepted
Headers show

Commit Message

Josef Bacik Aug. 18, 2016, 7:30 p.m. UTC
We need to call free_extent_map() on the em we look up.Btrfs: fix em leak in
find_first_block_group

We need to call free_extent_map() on the em we look up.

Signed-off-by: Josef Bacik <jbacik@fb.com>
---
 fs/btrfs/extent-tree.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Omar Sandoval Aug. 19, 2016, 5:31 p.m. UTC | #1
On Thu, Aug 18, 2016 at 03:30:06PM -0400, Josef Bacik wrote:
> We need to call free_extent_map() on the em we look up.Btrfs: fix em leak in
> find_first_block_group

Something weird happened with your patch here ^^^

> We need to call free_extent_map() on the em we look up.
> 
> Signed-off-by: Josef Bacik <jbacik@fb.com>

Reviewed-by: Omar Sandoval <osandov@fb.com>

> ---
>  fs/btrfs/extent-tree.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
> index 61b494e..20f9fa6 100644
> --- a/fs/btrfs/extent-tree.c
> +++ b/fs/btrfs/extent-tree.c
> @@ -9906,6 +9906,7 @@ static int find_first_block_group(struct btrfs_root *root,
>  			} else {
>  				ret = 0;
>  			}
> +			free_extent_map(em);
>  			goto out;
>  		}
>  		path->slots[0]++;
> -- 
> 1.8.3.1
David Sterba Aug. 23, 2016, 11:41 a.m. UTC | #2
On Fri, Aug 19, 2016 at 10:31:53AM -0700, Omar Sandoval wrote:
> On Thu, Aug 18, 2016 at 03:30:06PM -0400, Josef Bacik wrote:
> > We need to call free_extent_map() on the em we look up.Btrfs: fix em leak in
> > find_first_block_group
> 
> Something weird happened with your patch here ^^^

Fixed.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Liu Bo Aug. 24, 2016, 6:24 p.m. UTC | #3
On Thu, Aug 18, 2016 at 03:30:06PM -0400, Josef Bacik wrote:
> We need to call free_extent_map() on the em we look up.Btrfs: fix em leak in
> find_first_block_group
> 
> We need to call free_extent_map() on the em we look up.

Thanks for fixing it.

Reviewed-by: Liu Bo <bo.li.liu@oracle.com>

Thanks,

-liubo

> 
> Signed-off-by: Josef Bacik <jbacik@fb.com>
> ---
>  fs/btrfs/extent-tree.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
> index 61b494e..20f9fa6 100644
> --- a/fs/btrfs/extent-tree.c
> +++ b/fs/btrfs/extent-tree.c
> @@ -9906,6 +9906,7 @@ static int find_first_block_group(struct btrfs_root *root,
>  			} else {
>  				ret = 0;
>  			}
> +			free_extent_map(em);
>  			goto out;
>  		}
>  		path->slots[0]++;
> -- 
> 1.8.3.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 61b494e..20f9fa6 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -9906,6 +9906,7 @@  static int find_first_block_group(struct btrfs_root *root,
 			} else {
 				ret = 0;
 			}
+			free_extent_map(em);
 			goto out;
 		}
 		path->slots[0]++;