From: Josef Bacik <jbacik@fusionio.com>
To: Zach Brown <zab@redhat.com>
Cc: Josef Bacik <jbacik@fusionio.com>, <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH] Btrfs: deal with enomem in the rewind path V2
Date: Wed, 7 Aug 2013 16:18:29 -0400 [thread overview]
Message-ID: <20130807201829.GD2397@localhost.localdomain> (raw)
In-Reply-To: <20130807200230.GT12314@lenny.home.zabbo.net>
On Wed, Aug 07, 2013 at 01:02:30PM -0700, Zach Brown wrote:
> > --- a/fs/btrfs/ctree.c
> > +++ b/fs/btrfs/ctree.c
> > @@ -1211,7 +1211,8 @@ tree_mod_log_rewind(struct btrfs_fs_info *fs_info, struct extent_buffer *eb,
> > BUG_ON(tm->slot != 0);
> > eb_rewin = alloc_dummy_extent_buffer(eb->start,
> > fs_info->tree_root->nodesize);
> > - BUG_ON(!eb_rewin);
> > + if (!eb_rewin)
> > + return ERR_PTR(-ENOMEM);
>
> Don't these error paths need to unlock and free eb...
>
> > @@ -2772,6 +2774,10 @@ again:
> > BTRFS_READ_LOCK);
> > }
> > b = tree_mod_log_rewind(root->fs_info, b, time_seq);
> > + if (IS_ERR(b)) {
> > + ret = PTR_ERR(b);
> > + goto done;
> > + }
>
> ... because this b = doit(, b, ) will leak the b input eb if the b
> return is an error pointer?
>
Ah yeah I completely missed that, thanks.
Josef
prev parent reply other threads:[~2013-08-07 20:18 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-07 19:06 [PATCH] Btrfs: deal with enomem in the rewind path V2 Josef Bacik
2013-08-07 20:02 ` Zach Brown
2013-08-07 20:18 ` Josef Bacik [this message]
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=20130807201829.GD2397@localhost.localdomain \
--to=jbacik@fusionio.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=zab@redhat.com \
/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.