lkml.org 
[lkml]   [2014]   [Jan]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 3.11 009/208] Btrfs: fix memory leak of chunks' extent map
    Date
    3.11.10.3 -stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Liu Bo <bo.li.liu@oracle.com>

    commit 7d3d1744f8a7d62e4875bd69cc2192a939813880 upstream.

    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>
    Cc: David Sterba <dsterba@suse.cz>
    Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
    ---
    fs/btrfs/volumes.c | 2 ++
    1 file changed, 2 insertions(+)

    diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
    index 78b8717..feb93fc 100644
    --- a/fs/btrfs/volumes.c
    +++ b/fs/btrfs/volumes.c
    @@ -4203,6 +4203,7 @@ int btrfs_num_copies(struct btrfs_fs_info *fs_info, u64 logical, u64 len)
    btrfs_emerg(fs_info, "Invalid mapping for %Lu-%Lu, got "
    "%Lu-%Lu\n", logical, logical+len, em->start,
    em->start + em->len);
    + free_extent_map(em);
    return 1;
    }

    @@ -4384,6 +4385,7 @@ static int __btrfs_map_block(struct btrfs_fs_info *fs_info, int rw,
    btrfs_crit(fs_info, "found a bad mapping, wanted %Lu, "
    "found %Lu-%Lu\n", logical, em->start,
    em->start + em->len);
    + free_extent_map(em);
    return -EINVAL;
    }

    --
    1.8.3.2


    \
     
     \ /
      Last update: 2014-01-13 19:01    [W:2.642 / U:0.016 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site