[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PATCH v2 6/6] iscsi: Rely on block layer to break up large
From: |
Eric Blake |
Subject: |
[Qemu-block] [PATCH v2 6/6] iscsi: Rely on block layer to break up large requests |
Date: |
Fri, 8 Jul 2016 16:36:04 -0600 |
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>
---
block/iscsi.c | 14 ++++----------
1 file changed, 4 insertions(+), 10 deletions(-)
diff --git a/block/iscsi.c b/block/iscsi.c
index 9e62c3a..16d7d7d 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -473,11 +473,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);
@@ -651,11 +648,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 &&
--
2.5.5
- [Qemu-block] [PATCH v2 0/6] Auto-fragment large transactions at the block layer, Eric Blake, 2016/07/08
- [Qemu-block] [PATCH v2 2/6] raw_bsd: Don't advertise flags not supported by protocol layer, Eric Blake, 2016/07/08
- [Qemu-block] [PATCH v2 4/6] nbd: Rely on block layer to break up large requests, Eric Blake, 2016/07/08
- [Qemu-block] [PATCH v2 5/6] nbd: Drop unused offset parameter, Eric Blake, 2016/07/08
- [Qemu-block] [PATCH v2 6/6] iscsi: Rely on block layer to break up large requests,
Eric Blake <=
- [Qemu-block] [PATCH v2 1/6] block: Fragment reads to max transfer length, Eric Blake, 2016/07/08
- [Qemu-block] [PATCH v2 3/6] block: Fragment writes to max transfer length, Eric Blake, 2016/07/08
- Re: [Qemu-block] [PATCH v2 0/6] Auto-fragment large transactions at the block layer, Stefan Hajnoczi, 2016/07/14