iscsi: fix assertion in is_sector_request_lun_aligned
commit0ead93120eb7bd770b32adc00b5ec1ee721626dc
authorPeter Lieven <pl@kamp.de>
Mon, 20 Jun 2016 09:24:40 +0000 (20 11:24 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 29 Jun 2016 12:03:47 +0000 (29 14:03 +0200)
tree1e58adf3980ba142935ca3080465bd8a7e32c92a
parent8642c1b81e0418df066a7960a7426d85a923a253
iscsi: fix assertion in is_sector_request_lun_aligned

Commit 94d047a added an assertion the the request alignment check.
This introduced 2 issues:
 a) A off-by-one error since a request of BDRV_REQUEST_MAX_SECTORS
    is actually allowed.
 b) The bdrv_get_block_status call in the read path to check the allocation
    status requests up to INT_MAX sectors which triggers the assertion.

Fixes: 94d047a35bf663e28f8fef137544d8ea78165add
Signed-off-by: Peter Lieven <pl@kamp.de>
Message-Id: <1466414680-18383-1-git-send-email-pl@kamp.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
block/iscsi.c