All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: qemu-devel@nongnu.org
Cc: kwolf@redhat.com, famz@redhat.com, qemu-block@nongnu.org,
	Stefan Hajnoczi <stefanha@redhat.com>,
	Max Reitz <mreitz@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v2 1/6] block: Fragment reads to max transfer length
Date: Fri, 15 Jul 2016 08:28:53 -0600	[thread overview]
Message-ID: <5788F325.6040701@redhat.com> (raw)
In-Reply-To: <578861C4.2080700@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1457 bytes --]

On 07/14/2016 10:08 PM, Eric Blake wrote:
> On 07/08/2016 04:35 PM, Eric Blake wrote:
>> Drivers should be able to rely on the block layer honoring the
>> max transfer length, rather than needing to return -EINVAL
>> (iscsi) or manually fragment things (nbd).  This patch adds
>> the fragmentation in the block layer, after requests have been
>> aligned (fragmenting before alignment would lead to multiple
>> unaligned requests, rather than just the head and tail).
>>
>> The return value was previously nebulous on success (sometimes
>> zero, sometimes the length read); since we never have a short
>> read, and since fragmenting may store yet another positive
>> value in 'ret', change the function to always return the
>> incoming 'bytes' value on success.
>>
>> Signed-off-by: Eric Blake <eblake@redhat.com>
>>
>> ---
>> v2: Fix uninitialized use of 'ret' for an all-zero read beyond eof
> 
> Uggh. Something I did here and not in v1 is now causing 'make
> check-qtest' failures. Please don't merge until I've posted v3.

Looks like there is at least one caller that expects
bdrv_aligned_preadv() to return 0 (not positive) on success; I'm not
sure which one(s), as it turned into a lot of code to chase, but a
simple tweak to guarantee ret = 0 on success solves the failures in
'make check'.  v3 coming up soon.

-- 
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 --]

  reply	other threads:[~2016-07-15 14:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-08 22:35 [Qemu-devel] [PATCH v2 0/6] Auto-fragment large transactions at the block layer Eric Blake
2016-07-08 22:35 ` [Qemu-devel] [PATCH v2 1/6] block: Fragment reads to max transfer length Eric Blake
2016-07-15  4:08   ` Eric Blake
2016-07-15 14:28     ` Eric Blake [this message]
2016-07-08 22:36 ` [Qemu-devel] [PATCH v2 2/6] raw_bsd: Don't advertise flags not supported by protocol layer Eric Blake
2016-07-08 22:36 ` [Qemu-devel] [PATCH v2 3/6] block: Fragment writes to max transfer length Eric Blake
2016-07-08 22:36 ` [Qemu-devel] [PATCH v2 4/6] nbd: Rely on block layer to break up large requests Eric Blake
2016-07-08 22:36 ` [Qemu-devel] [PATCH v2 5/6] nbd: Drop unused offset parameter Eric Blake
2016-07-08 22:36 ` [Qemu-devel] [PATCH v2 6/6] iscsi: Rely on block layer to break up large requests Eric Blake
2016-07-14 12:18 ` [Qemu-devel] [Qemu-block] [PATCH v2 0/6] Auto-fragment large transactions at the block layer 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=5788F325.6040701@redhat.com \
    --to=eblake@redhat.com \
    --cc=famz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@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.