Received: from eggs.gnu.org ([2001:4830:134:3::10]:41164) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YtEcB-0005wE-9x for qemu-devel@nongnu.org; Fri, 15 May 2015 08:21:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YtEcA-0006zG-Cm for qemu-devel@nongnu.org; Fri, 15 May 2015 08:21:19 -0400 From: Markus Armbruster References: <1431678966-16470-1-git-send-email-famz@redhat.com> Date: Fri, 15 May 2015 14:20:30 +0200 In-Reply-To: <1431678966-16470-1-git-send-email-famz@redhat.com> (Fam Zheng's message of "Fri, 15 May 2015 16:36:04 +0800") Message-ID: <87a8x6ghgx.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v2 0/2] block: Fix error code for bdrv_getlength when the image is too big List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: Kevin Wolf , berto@igalia.com, qemu-devel@nongnu.org, qemu-block@nongnu.org Fam Zheng writes: > v2: Correct detection of overflow. [Markus, Berto] > > If the image has a huge enough virtual size, > > $ qemu-img info afl9.img > qemu-img: Can't get size of device 'image': Unknown error -512 > > It's because of the multiplication overflow in the return statement in > bdrv_getlength (the big nagetive value is later truncated to 0x200). Fix it to > return -EFBIG: > > qemu-img: Can't get size of device 'image': File too large > > Bug reported by Richard Jones in: > > https://bugzilla.redhat.com/show_bug.cgi?id=1221499 Series Reviewed-by: Markus Armbruster