From: Kevin Wolf <kwolf@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Qemu-block <qemu-block@nongnu.org>,
QEMU Developers <qemu-devel@nongnu.org>,
qemu-stable@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] commit: Add NULL check for overlay_bs
Date: Tue, 11 Jul 2017 11:37:34 +0200 [thread overview]
Message-ID: <20170711093734.GF4335@noname.str.redhat.com> (raw)
In-Reply-To: <CAFEAcA_2dB3rN6mJcwrxShPaEO8dEzoNU27dTkWC3jjnjRPC6g@mail.gmail.com>
Am 10.07.2017 um 14:09 hat Peter Maydell geschrieben:
> On 10 July 2017 at 12:45, Kevin Wolf <kwolf@redhat.com> wrote:
> > I can't see how overlay_bs could become NULL with the current code, but
> > other code in this function already checks it and we can make Coverity
> > happy with this check, so let's add it.
> >
> > Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> > ---
> > block/commit.c | 4 +++-
> > 1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/block/commit.c b/block/commit.c
> > index 774a8a5..50e7950 100644
> > --- a/block/commit.c
> > +++ b/block/commit.c
> > @@ -90,7 +90,9 @@ static void commit_complete(BlockJob *job, void *opaque)
> >
> > /* Make sure overlay_bs and top stay around until bdrv_set_backing_hd() */
> > bdrv_ref(top);
> > - bdrv_ref(overlay_bs);
> > + if (overlay_bs) {
> > + bdrv_ref(overlay_bs);
> > + }
> >
> > /* Remove base node parent that still uses BLK_PERM_WRITE/RESIZE before
> > * the normal backing chain can be restored. */
>
> Commit 19ebd13ed45ad5d5f2 which added the bdrv_ref() call
> was cc qemu-stable; should we cc this fix too, or are you
> happy that it's definitely not actually triggerable in stable?
Okay, I'll add the CC, better safe than sorry.
Kevin
next prev parent reply other threads:[~2017-07-11 9:37 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-10 11:45 [Qemu-devel] [PATCH] commit: Add NULL check for overlay_bs Kevin Wolf
2017-07-10 12:09 ` Peter Maydell
2017-07-11 9:37 ` Kevin Wolf [this message]
2017-07-11 9:30 ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
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=20170711093734.GF4335@noname.str.redhat.com \
--to=kwolf@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-stable@nongnu.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 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).