[{"id":1771982,"web_url":"http://patchwork.ozlabs.org/comment/1771982/","msgid":"<d897c151-f2a4-fa44-11dd-e12503b41b61@redhat.com>","list_archive_url":null,"date":"2017-09-20T14:27:45","subject":"Re: [Qemu-devel] [PATCH 1/2] qcow2: fix return error code in\n\tqcow2_truncate()","submitter":{"id":6591,"url":"http://patchwork.ozlabs.org/api/people/6591/","name":"Eric Blake","email":"eblake@redhat.com"},"content":"On 09/20/2017 08:58 AM, Pavel Butsykin wrote:\n> Signed-off-by: Pavel Butsykin <pbutsykin@virtuozzo.com>\n> ---\n>  block/qcow2.c | 4 ++--\n>  1 file changed, 2 insertions(+), 2 deletions(-)\n\nWow, bdrv_truncate() has had problems!  You found fixes unrelated to my\ncurrent struggles to fix the dirty-bitmap failure.\n\nReviewed-by: Eric Blake <eblake@redhat.com>\nCC: qemu-stable@nongnu.org\n\n> \n> diff --git a/block/qcow2.c b/block/qcow2.c\n> index 2174a84d1f..8a4311d338 100644\n> --- a/block/qcow2.c\n> +++ b/block/qcow2.c\n> @@ -3166,7 +3166,7 @@ static int qcow2_truncate(BlockDriverState *bs, int64_t offset,\n>          if (old_file_size < 0) {\n>              error_setg_errno(errp, -old_file_size,\n>                               \"Failed to inquire current file length\");\n> -            return ret;\n> +            return old_file_size;\n>          }\n>  \n>          nb_new_data_clusters = DIV_ROUND_UP(offset - old_length,\n> @@ -3195,7 +3195,7 @@ static int qcow2_truncate(BlockDriverState *bs, int64_t offset,\n>          if (allocation_start < 0) {\n>              error_setg_errno(errp, -allocation_start,\n>                               \"Failed to resize refcount structures\");\n> -            return -allocation_start;\n> +            return allocation_start;\n>          }\n>  \n>          clusters_allocated = qcow2_alloc_clusters_at(bs, allocation_start,\n>","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx06.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx06.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=eblake@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xy3Rx6MSdz9sPt\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 21 Sep 2017 01:23:57 +1000 (AEST)","from localhost ([::1]:48823 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dugqx-0001td-Rt\n\tfor incoming@patchwork.ozlabs.org; Wed, 20 Sep 2017 11:23:55 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:60134)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <eblake@redhat.com>) id 1dufyu-00084z-0x\n\tfor qemu-devel@nongnu.org; Wed, 20 Sep 2017 10:28:08 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <eblake@redhat.com>) id 1dufyp-0002CQ-US\n\tfor qemu-devel@nongnu.org; Wed, 20 Sep 2017 10:28:04 -0400","from mx1.redhat.com ([209.132.183.28]:38018)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <eblake@redhat.com>)\n\tid 1dufye-0001y1-9W; Wed, 20 Sep 2017 10:27:48 -0400","from smtp.corp.redhat.com\n\t(int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 2217F25C28;\n\tWed, 20 Sep 2017 14:27:47 +0000 (UTC)","from [10.10.124.97] (ovpn-124-97.rdu2.redhat.com [10.10.124.97])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id D654B5D986;\n\tWed, 20 Sep 2017 14:27:45 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 2217F25C28","To":"Pavel Butsykin <pbutsykin@virtuozzo.com>, qemu-block@nongnu.org,\n\tqemu-devel@nongnu.org","References":"<20170920135833.20472-1-pbutsykin@virtuozzo.com>\n\t<20170920135833.20472-2-pbutsykin@virtuozzo.com>","From":"Eric Blake <eblake@redhat.com>","Openpgp":"url=http://people.redhat.com/eblake/eblake.gpg","Organization":"Red Hat, Inc.","Message-ID":"<d897c151-f2a4-fa44-11dd-e12503b41b61@redhat.com>","Date":"Wed, 20 Sep 2017 09:27:45 -0500","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<20170920135833.20472-2-pbutsykin@virtuozzo.com>","Content-Type":"multipart/signed; micalg=pgp-sha256;\n\tprotocol=\"application/pgp-signature\";\n\tboundary=\"WoHFxAR3fPmIc7ep5niifqQPVhOsJLI62\"","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.14","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.30]);\n\tWed, 20 Sep 2017 14:27:47 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","X-Content-Filtered-By":"Mailman/MimeDel 2.1.21","Subject":"Re: [Qemu-devel] [PATCH 1/2] qcow2: fix return error code in\n\tqcow2_truncate()","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"kwolf@redhat.com, den@openvz.org, qemu-stable <qemu-stable@nongnu.org>, \n\tmreitz@redhat.com","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1772185,"web_url":"http://patchwork.ozlabs.org/comment/1772185/","msgid":"<eaef3a7c-e634-50bb-a98c-9d5db7446c00@redhat.com>","list_archive_url":null,"date":"2017-09-20T20:17:29","subject":"Re: [Qemu-devel] [Qemu-block] [PATCH 1/2] qcow2: fix return error\n\tcode in qcow2_truncate()","submitter":{"id":64343,"url":"http://patchwork.ozlabs.org/api/people/64343/","name":"John Snow","email":"jsnow@redhat.com"},"content":"On 09/20/2017 09:58 AM, Pavel Butsykin wrote:\n> Signed-off-by: Pavel Butsykin <pbutsykin@virtuozzo.com>\n> ---\n>  block/qcow2.c | 4 ++--\n>  1 file changed, 2 insertions(+), 2 deletions(-)\n> \n> diff --git a/block/qcow2.c b/block/qcow2.c\n> index 2174a84d1f..8a4311d338 100644\n> --- a/block/qcow2.c\n> +++ b/block/qcow2.c\n> @@ -3166,7 +3166,7 @@ static int qcow2_truncate(BlockDriverState *bs, int64_t offset,\n>          if (old_file_size < 0) {\n>              error_setg_errno(errp, -old_file_size,\n>                               \"Failed to inquire current file length\");\n> -            return ret;\n> +            return old_file_size;\n>          }\n>  \n>          nb_new_data_clusters = DIV_ROUND_UP(offset - old_length,\n> @@ -3195,7 +3195,7 @@ static int qcow2_truncate(BlockDriverState *bs, int64_t offset,\n>          if (allocation_start < 0) {\n>              error_setg_errno(errp, -allocation_start,\n>                               \"Failed to resize refcount structures\");\n> -            return -allocation_start;\n> +            return allocation_start;\n>          }\n>  \n>          clusters_allocated = qcow2_alloc_clusters_at(bs, allocation_start,\n> \n\nYikes...\n\nReviewed-by: John Snow <jsnow@redhat.com>","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx03.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx03.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=jsnow@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xy9zM57xHz9s7h\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 21 Sep 2017 06:18:07 +1000 (AEST)","from localhost ([::1]:50478 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dulRd-0007fw-Ly\n\tfor incoming@patchwork.ozlabs.org; Wed, 20 Sep 2017 16:18:05 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:51144)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <jsnow@redhat.com>) id 1dulRB-0007d4-6c\n\tfor qemu-devel@nongnu.org; Wed, 20 Sep 2017 16:17:42 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <jsnow@redhat.com>) id 1dulRA-0002PL-7d\n\tfor qemu-devel@nongnu.org; Wed, 20 Sep 2017 16:17:37 -0400","from mx1.redhat.com ([209.132.183.28]:58902)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <jsnow@redhat.com>)\n\tid 1dulR5-0002MI-Pz; Wed, 20 Sep 2017 16:17:31 -0400","from smtp.corp.redhat.com\n\t(int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id A5F767E426;\n\tWed, 20 Sep 2017 20:17:30 +0000 (UTC)","from [10.18.17.130] (dhcp-17-130.bos.redhat.com [10.18.17.130])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id CE8E75D984;\n\tWed, 20 Sep 2017 20:17:29 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com A5F767E426","To":"Pavel Butsykin <pbutsykin@virtuozzo.com>, qemu-block@nongnu.org,\n\tqemu-devel@nongnu.org","References":"<20170920135833.20472-1-pbutsykin@virtuozzo.com>\n\t<20170920135833.20472-2-pbutsykin@virtuozzo.com>","From":"John Snow <jsnow@redhat.com>","Message-ID":"<eaef3a7c-e634-50bb-a98c-9d5db7446c00@redhat.com>","Date":"Wed, 20 Sep 2017 16:17:29 -0400","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<20170920135833.20472-2-pbutsykin@virtuozzo.com>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-US","Content-Transfer-Encoding":"7bit","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.14","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.27]);\n\tWed, 20 Sep 2017 20:17:31 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [Qemu-block] [PATCH 1/2] qcow2: fix return error\n\tcode in qcow2_truncate()","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"kwolf@redhat.com, den@openvz.org, mreitz@redhat.com","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1772929,"web_url":"http://patchwork.ozlabs.org/comment/1772929/","msgid":"<fae814ca-002b-fd3f-88ec-49f4729ca37f@redhat.com>","list_archive_url":null,"date":"2017-09-21T15:28:30","subject":"Re: [Qemu-devel] [PATCH 1/2] qcow2: fix return error code in\n\tqcow2_truncate()","submitter":{"id":36836,"url":"http://patchwork.ozlabs.org/api/people/36836/","name":"Max Reitz","email":"mreitz@redhat.com"},"content":"On 2017-09-20 15:58, Pavel Butsykin wrote:\n> Signed-off-by: Pavel Butsykin <pbutsykin@virtuozzo.com>\n> ---\n>  block/qcow2.c | 4 ++--\n>  1 file changed, 2 insertions(+), 2 deletions(-)\n\nReviewed-by: Max Reitz <mreitz@redhat.com>","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx09.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx09.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=mreitz@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xygXW17rKz9t49\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 22 Sep 2017 01:30:03 +1000 (AEST)","from localhost ([::1]:54205 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dv3QP-00066F-A8\n\tfor incoming@patchwork.ozlabs.org; Thu, 21 Sep 2017 11:30:01 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:35981)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <mreitz@redhat.com>) id 1dv3P6-0005V3-6I\n\tfor qemu-devel@nongnu.org; Thu, 21 Sep 2017 11:28:41 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <mreitz@redhat.com>) id 1dv3P5-0004h5-EX\n\tfor qemu-devel@nongnu.org; Thu, 21 Sep 2017 11:28:40 -0400","from mx1.redhat.com ([209.132.183.28]:33790)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <mreitz@redhat.com>)\n\tid 1dv3P1-0004cy-KB; Thu, 21 Sep 2017 11:28:35 -0400","from smtp.corp.redhat.com\n\t(int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 9D964D6F0E;\n\tThu, 21 Sep 2017 15:28:34 +0000 (UTC)","from dresden.str.redhat.com (ovpn-204-199.brq.redhat.com\n\t[10.40.204.199])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id 9B9525EE06;\n\tThu, 21 Sep 2017 15:28:32 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 9D964D6F0E","To":"Pavel Butsykin <pbutsykin@virtuozzo.com>, qemu-block@nongnu.org,\n\tqemu-devel@nongnu.org","References":"<20170920135833.20472-1-pbutsykin@virtuozzo.com>\n\t<20170920135833.20472-2-pbutsykin@virtuozzo.com>","From":"Max Reitz <mreitz@redhat.com>","Message-ID":"<fae814ca-002b-fd3f-88ec-49f4729ca37f@redhat.com>","Date":"Thu, 21 Sep 2017 17:28:30 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<20170920135833.20472-2-pbutsykin@virtuozzo.com>","Content-Type":"multipart/signed; micalg=pgp-sha256;\n\tprotocol=\"application/pgp-signature\";\n\tboundary=\"COWTdeMRSbTOKVl4pSnJv6NiM2CKWn5rJ\"","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.15","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.38]);\n\tThu, 21 Sep 2017 15:28:34 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","X-Content-Filtered-By":"Mailman/MimeDel 2.1.21","Subject":"Re: [Qemu-devel] [PATCH 1/2] qcow2: fix return error code in\n\tqcow2_truncate()","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"kwolf@redhat.com, den@openvz.org","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}}]