From: Qu Wenruo <quwenruo@cn.fujitsu.com>
To: <linux-btrfs@vger.kernel.org>
Cc: <dsterba@suse.cz>
Subject: Re: [PATCH] btrfs-progs: Fix 2 extent buffer leak in btrfs-debug-tree.
Date: Wed, 11 Feb 2015 10:02:14 +0800 [thread overview]
Message-ID: <54DAB826.9010400@cn.fujitsu.com> (raw)
In-Reply-To: <1423619837-24073-1-git-send-email-quwenruo@cn.fujitsu.com>
-------- Original Message --------
Subject: [PATCH] btrfs-progs: Fix 2 extent buffer leak in btrfs-debug-tree.
From: Qu Wenruo <quwenruo@cn.fujitsu.com>
To: <linux-btrfs@vger.kernel.org>
Date: 2015年02月11日 09:57
> There are 2 known extent buffer:
Oh, a small typo: "2 known extent buffer leak:", missing the word leak.
> 1) With -t option.
> -t option will skip other tree roots, but it will read the root node
> first and then skip it.
> Where it forgets to free the tree block it read.
>
> 2) with -b option.
> It forgets to free the tree block it read.
>
> Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
> ---
> btrfs-debug-tree.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/btrfs-debug-tree.c b/btrfs-debug-tree.c
> index ce7a792..610624e 100644
> --- a/btrfs-debug-tree.c
> +++ b/btrfs-debug-tree.c
> @@ -221,6 +221,7 @@ int main(int ac, char **av)
> goto close_root;
> }
> btrfs_print_tree(root, leaf, 0);
> + free_extent_buffer(leaf);
> goto close_root;
> }
>
> @@ -284,8 +285,10 @@ again:
> 0);
> if (!extent_buffer_uptodate(buf))
> goto next;
> - if (tree_id && found_key.objectid != tree_id)
> + if (tree_id && found_key.objectid != tree_id) {
> + free_extent_buffer(buf);
> goto next;
> + }
>
> switch(found_key.objectid) {
> case BTRFS_ROOT_TREE_OBJECTID:
next prev parent reply other threads:[~2015-02-11 2:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-11 1:57 [PATCH] btrfs-progs: Fix 2 extent buffer leak in btrfs-debug-tree Qu Wenruo
2015-02-11 2:02 ` Qu Wenruo [this message]
2015-02-11 18:08 ` David Sterba
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54DAB826.9010400@cn.fujitsu.com \
--to=quwenruo@cn.fujitsu.com \
--cc=dsterba@suse.cz \
--cc=linux-btrfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.