From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39811) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bG7MR-0001An-15 for qemu-devel@nongnu.org; Thu, 23 Jun 2016 12:20:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bG7MI-0006cA-Gd for qemu-devel@nongnu.org; Thu, 23 Jun 2016 12:20:10 -0400 Received: from mx-v6.kamp.de ([2a02:248:0:51::16]:35617 helo=mx01.kamp.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bG7MI-0006c0-7L for qemu-devel@nongnu.org; Thu, 23 Jun 2016 12:20:02 -0400 References: <1466414680-18383-1-git-send-email-pl@kamp.de> <86281c43-7a2f-df46-9297-03629bbd5281@redhat.com> From: Peter Lieven Message-ID: <576C0C2C.3090706@kamp.de> Date: Thu, 23 Jun 2016 18:19:56 +0200 MIME-Version: 1.0 In-Reply-To: <86281c43-7a2f-df46-9297-03629bbd5281@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] iscsi: fix assertion in is_sector_request_lun_aligned List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , qemu-block@nongnu.org Cc: qemu-devel@nongnu.org, kwolf@redhat.com, mreitz@redhat.com, ronniesahlberg@gmail.com, eblake@redhat.com Am 23.06.2016 um 17:50 schrieb Paolo Bonzini: > On 20/06/2016 11:24, Peter Lieven wrote: >> 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 >> --- >> block/iscsi.c | 5 +++-- >> 1 file changed, 3 insertions(+), 2 deletions(-) >> >> diff --git a/block/iscsi.c b/block/iscsi.c >> index 7e78ade..9bb5ff6 100644 >> --- a/block/iscsi.c >> +++ b/block/iscsi.c >> @@ -417,7 +417,7 @@ static bool is_byte_request_lun_aligned(int64_t offset, int count, >> static bool is_sector_request_lun_aligned(int64_t sector_num, int nb_sectors, >> IscsiLun *iscsilun) >> { >> - assert(nb_sectors < BDRV_REQUEST_MAX_SECTORS); >> + assert(nb_sectors <= BDRV_REQUEST_MAX_SECTORS); >> return is_byte_request_lun_aligned(sector_num << BDRV_SECTOR_BITS, >> nb_sectors << BDRV_SECTOR_BITS, >> iscsilun); >> @@ -661,7 +661,8 @@ static int coroutine_fn iscsi_co_readv(BlockDriverState *bs, >> int64_t ret; >> int pnum; >> BlockDriverState *file; >> - ret = iscsi_co_get_block_status(bs, sector_num, INT_MAX, &pnum, &file); >> + ret = iscsi_co_get_block_status(bs, sector_num, >> + BDRV_REQUEST_MAX_SECTORS, &pnum, &file); >> if (ret < 0) { >> return ret; >> } >> > Hi, I've queued this patch. Can you rebase the allocation map patch on > top of master + this one? will do. Peter