From: Eric Blake <eblake@redhat.com>
To: Alberto Garcia <berto@igalia.com>, qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
qemu-block@nongnu.org, Max Reitz <mreitz@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 1/2] qemu-io: don't allow I/O operations larger than INT_MAX
Date: Tue, 31 Jan 2017 10:31:32 -0600 [thread overview]
Message-ID: <f9e9efcc-2a59-db47-a048-763eed52d92f@redhat.com> (raw)
In-Reply-To: <79f66648c685929a144396bda24d13a207131dcf.1485878688.git.berto@igalia.com>
[-- Attachment #1: Type: text/plain, Size: 1152 bytes --]
On 01/31/2017 10:09 AM, Alberto Garcia wrote:
> Passing a request size larger than INT_MAX to any of the I/O commands
> results in an error. While 'read' and 'write' handle the error
> correctly, 'aio_read' and 'aio_write' hit an assertion:
>
> blk_aio_read_entry: Assertion `rwco->qiov->size == acb->bytes' failed.
>
> The reason is that the QEMU I/O code cannot handle request sizes
> larger than INT_MAX, so this patch makes qemu-io check that all values
> are within range.
Ideally, it would be nice to fix the block layer to allow larger
requests (since we already have code to auto-fragment down to device
limits, we should be able to rely on that code instead of having to
duplicate artificial constraints everywhere else in the tree). But
that's a bigger task, and this is a good patch in the interim.
>
> Signed-off-by: Alberto Garcia <berto@igalia.com>
> ---
> qemu-io-cmds.c | 21 ++++++++++++---------
> 1 file changed, 12 insertions(+), 9 deletions(-)
Reviewed-by: Eric Blake <eblake@redhat.com>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
next prev parent reply other threads:[~2017-01-31 16:31 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-31 16:09 [Qemu-devel] [PATCH 0/2] qemu-io: check the size of the I/O requests Alberto Garcia
2017-01-31 16:09 ` [Qemu-devel] [PATCH 1/2] qemu-io: don't allow I/O operations larger than INT_MAX Alberto Garcia
2017-01-31 16:31 ` Eric Blake [this message]
2017-01-31 16:36 ` Alberto Garcia
2017-01-31 16:41 ` Eric Blake
2017-01-31 18:11 ` Alberto Garcia
2017-01-31 22:33 ` Max Reitz
2017-02-01 21:36 ` Max Reitz
2017-02-01 21:49 ` Alberto Garcia
2017-02-01 22:16 ` Max Reitz
2017-02-02 8:52 ` Alberto Garcia
2017-02-03 19:00 ` Max Reitz
2017-01-31 16:09 ` [Qemu-devel] [PATCH 2/2] iov: assert that qiov->size doesn't exceed INT_MAX Alberto Garcia
2017-01-31 16:45 ` Eric Blake
2017-02-01 21:51 ` Max Reitz
2017-02-01 21:55 ` Alberto Garcia
2017-02-01 21:56 ` Max Reitz
2017-02-01 22:00 ` Alberto Garcia
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=f9e9efcc-2a59-db47-a048-763eed52d92f@redhat.com \
--to=eblake@redhat.com \
--cc=berto@igalia.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@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).