summaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
Diffstat (limited to 'block')
-rw-r--r--block/iscsi.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/block/iscsi.c b/block/iscsi.c
index 9bb5ff6216..c5dedb3407 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -1698,7 +1698,9 @@ static void iscsi_close(BlockDriverState *bs)
static int sector_limits_lun2qemu(int64_t sector, IscsiLun *iscsilun)
{
- return MIN(sector_lun2qemu(sector, iscsilun), INT_MAX / 2 + 1);
+ int limit = MIN(sector_lun2qemu(sector, iscsilun), INT_MAX / 2 + 1);
+
+ return limit < BDRV_REQUEST_MAX_SECTORS ? limit : 0;
}
static void iscsi_refresh_limits(BlockDriverState *bs, Error **errp)