Message ID | 1466721446-27737-7-git-send-email-eblake@redhat.com |
---|---|
State | New |
Headers | show |
diff --git a/block/iscsi.c b/block/iscsi.c index 7e78ade..4290e41 100644 --- a/block/iscsi.c +++ b/block/iscsi.c @@ -1697,7 +1697,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)