qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v3 6/6] iscsi: Rely on block layer to break up l


From: Paolo Bonzini
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
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1


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 <address@hidden>
> Reviewed-by: Fam Zheng <address@hidden>
> Reviewed-by: Stefan Hajnoczi <address@hidden>
> ---
>  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 <address@hidden>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]