From: Liu Bo <bo.li.liu@oracle.com>
To: dsterba@suse.cz
Cc: "Holger Hoffstätte" <holger.hoffstaette@googlemail.com>,
linux-btrfs@vger.kernel.org, master.b.at.raven@chefmail.de
Subject: Re: [PATCH] Btrfs: fix unexpected balance crash due to BUG_ON
Date: Fri, 8 Jul 2016 14:26:23 -0700 [thread overview]
Message-ID: <20160708212623.GB26260@localhost.localdomain> (raw)
In-Reply-To: <20160708160516.GQ13336@twin.jikos.cz>
On Fri, Jul 08, 2016 at 06:05:16PM +0200, David Sterba wrote:
> On Tue, May 03, 2016 at 04:30:54PM -0700, Liu Bo wrote:
> > > Just a heads up that this seems to introduce a valid warning, since it now
> > > can goto error before the first initializing use of path:
> > >
> > > fs/btrfs/volumes.c: In function 'btrfs_balance':
> > > fs/btrfs/volumes.c:3601:2: warning: 'path' may be used uninitialized
> > > in this function [-Wmaybe-uninitialized]
> > > btrfs_free_path(path);
> > > ^
> > > fs/btrfs/volumes.c:3385:21: note: 'path' was declared here
> > > struct btrfs_path *path;
> > > ^
> > > (it's really in __btrfs_balance which got inlined, so gcc thinks it's
> > > at the call site).
> > >
> > > Simply setting path = NULL at the beginning of __btrfs_balance fixes it, since
> > > btrfs_free_path allows NULL values.
> >
> > That's right, it's weird that I didn't get this warning while testing it.
> >
> > Thanks for catching it, Holger.
>
> Please send a v2, the patch is desiable.
Oh, I almost forgot this one, thanks for the reminder.
Thanks,
-liubo
next prev parent reply other threads:[~2016-07-08 21:27 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-02 23:01 [PATCH] Btrfs: fix unexpected balance crash due to BUG_ON Liu Bo
2016-05-03 23:14 ` Holger Hoffstätte
2016-05-03 23:30 ` Liu Bo
2016-07-08 16:05 ` David Sterba
2016-07-08 21:26 ` Liu Bo [this message]
2016-05-04 14:59 ` 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=20160708212623.GB26260@localhost.localdomain \
--to=bo.li.liu@oracle.com \
--cc=dsterba@suse.cz \
--cc=holger.hoffstaette@googlemail.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=master.b.at.raven@chefmail.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).