From: Paolo Bonzini <pbonzini@redhat.com>
To: Eric Blake <eblake@redhat.com>, qemu-devel@nongnu.org
Cc: kwolf@redhat.com, famz@redhat.com, qemu-block@nongnu.org,
stefanha@redhat.com, Ronnie Sahlberg <ronniesahlberg@gmail.com>,
Peter Lieven <pl@kamp.de>, Max Reitz <mreitz@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v3 6/6] iscsi: Rely on block layer to break up large requests
Date: Mon, 18 Jul 2016 10:16:20 +0200 [thread overview]
Message-ID: <4ba37e5e-61e1-7a40-1a2c-f54dfe5525bc@redhat.com> (raw)
In-Reply-To: <1468607524-19021-7-git-send-email-eblake@redhat.com>
On 15/07/2016 20:32, Eric Blake wrote:
> Now that the block layer honors max_request, we don't need to
> bother with an EINVAL on overlarge requests, but can instead
> assert that requests are well-behaved.
>
> Signed-off-by: Eric Blake <eblake@redhat.com>
> Reviewed-by: Fam Zheng <famz@redhat.com>
> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
> ---
> block/iscsi.c | 14 ++++----------
> 1 file changed, 4 insertions(+), 10 deletions(-)
>
> diff --git a/block/iscsi.c b/block/iscsi.c
> index cf1e9e7..bdc7ade 100644
> --- a/block/iscsi.c
> +++ b/block/iscsi.c
> @@ -472,11 +472,8 @@ iscsi_co_writev_flags(BlockDriverState *bs, int64_t sector_num, int nb_sectors,
> return -EINVAL;
> }
>
> - if (bs->bl.max_transfer &&
> - nb_sectors << BDRV_SECTOR_BITS > bs->bl.max_transfer) {
> - error_report("iSCSI Error: Write of %d sectors exceeds max_xfer_len "
> - "of %" PRIu32 " bytes", nb_sectors, bs->bl.max_transfer);
> - return -EINVAL;
> + if (bs->bl.max_transfer) {
> + assert(nb_sectors << BDRV_SECTOR_BITS <= bs->bl.max_transfer);
> }
>
> lba = sector_qemu2lun(sector_num, iscsilun);
> @@ -650,11 +647,8 @@ static int coroutine_fn iscsi_co_readv(BlockDriverState *bs,
> return -EINVAL;
> }
>
> - if (bs->bl.max_transfer &&
> - nb_sectors << BDRV_SECTOR_BITS > bs->bl.max_transfer) {
> - error_report("iSCSI Error: Read of %d sectors exceeds max_xfer_len "
> - "of %" PRIu32 " bytes", nb_sectors, bs->bl.max_transfer);
> - return -EINVAL;
> + if (bs->bl.max_transfer) {
> + assert(nb_sectors << BDRV_SECTOR_BITS <= bs->bl.max_transfer);
> }
>
> if (iscsilun->lbprz && nb_sectors >= ISCSI_CHECKALLOC_THRES &&
>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
next prev parent reply other threads:[~2016-07-18 8:16 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-15 18:31 [Qemu-devel] [PATCH v3 0/6] Auto-fragment large transactions at the block layer Eric Blake
2016-07-15 18:31 ` [Qemu-devel] [PATCH v3 1/6] block: Fragment reads to max transfer length Eric Blake
2016-07-15 18:32 ` [Qemu-devel] [PATCH v3 2/6] raw_bsd: Don't advertise flags not supported by protocol layer Eric Blake
2016-07-15 18:32 ` [Qemu-devel] [PATCH v3 3/6] block: Fragment writes to max transfer length Eric Blake
2016-07-15 18:32 ` [Qemu-devel] [PATCH v3 4/6] nbd: Rely on block layer to break up large requests Eric Blake
2016-07-18 8:16 ` Paolo Bonzini
2016-07-15 18:32 ` [Qemu-devel] [PATCH v3 5/6] nbd: Drop unused offset parameter Eric Blake
2016-07-18 8:16 ` Paolo Bonzini
2016-07-15 18:32 ` [Qemu-devel] [PATCH v3 6/6] iscsi: Rely on block layer to break up large requests Eric Blake
2016-07-18 8:16 ` Paolo Bonzini [this message]
2016-07-19 16:12 ` [Qemu-devel] [PATCH v3 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=4ba37e5e-61e1-7a40-1a2c-f54dfe5525bc@redhat.com \
--to=pbonzini@redhat.com \
--cc=eblake@redhat.com \
--cc=famz@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=pl@kamp.de \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=ronniesahlberg@gmail.com \
--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 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).