From: Kevin Wolf <kwolf@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: John Snow <jsnow@redhat.com>,
Stefan Hajnoczi <stefanha@gmail.com>, P J P <ppandit@redhat.com>,
Qemu Developers <qemu-devel@nongnu.org>,
qemu-block@nongnu.org,
Kieron Shorrock <kshorrock@paloaltonetworks.com>,
Prasad J Pandit <pjp@fedoraproject.org>,
Markus Armbruster <armbru@redhat.com>
Subject: Re: [Qemu-devel] [Qemu-block] [PATCH] block: check BlockDriverState object before dereference
Date: Tue, 1 Aug 2017 15:40:26 +0200 [thread overview]
Message-ID: <20170801134026.GB4257@localhost.localdomain> (raw)
In-Reply-To: <3a90fa30-00b3-b389-5b78-54b55046648c@redhat.com>
Am 01.08.2017 um 10:35 hat Paolo Bonzini geschrieben:
> On 01/08/2017 02:14, John Snow wrote:
> > I may need some nudging towards understanding what the right solution
> > here is, though. Should the blk_aio_flush assume that there always is a
> > root BDS? should it not assume that?
>
> I think blk_aio_flush is not special. If there is no root BDS, either
> you return -ENOMEDIUM, or you crash. But all functions should be doing
> the same.
The intended semantics is that they return -ENOMEDIUM (or fail at
least). This is how things have always worked, and that it crashes now
because of the bdrv_inc_in_flight() was not an intentional change, but
simply a bug in the patch.
> The former makes sense, but right now blk_prwv for one are crashing if
> there is no root BDS so the minimum patch would fix the caller rather
> than blk_aio_flush.
The synchronous versions don't crash, and bdrv_aio_prwv() would fix all
cases if bdrv_inc_in_flight() were moved inside the coroutine; probably
right before blk_aio_complete(). This would be more consistent with how
the synchronous versions work, too, increasing the in-flight count only
by 1 rather than 2 for an AIO request.
Kevin
prev parent reply other threads:[~2017-08-01 13:40 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-11 17:08 [Qemu-devel] [PATCH] block: check BlockDriverState object before dereference P J P
2017-07-17 15:56 ` [Qemu-devel] [Qemu-block] " John Snow
2017-07-21 15:47 ` Stefan Hajnoczi
2017-07-23 14:36 ` Paolo Bonzini
2017-08-01 0:14 ` John Snow
2017-08-01 8:35 ` Paolo Bonzini
2017-08-01 13:40 ` Kevin Wolf [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=20170801134026.GB4257@localhost.localdomain \
--to=kwolf@redhat.com \
--cc=armbru@redhat.com \
--cc=jsnow@redhat.com \
--cc=kshorrock@paloaltonetworks.com \
--cc=pbonzini@redhat.com \
--cc=pjp@fedoraproject.org \
--cc=ppandit@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@gmail.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 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).