Message ID | 20170922093926.9723-2-pbutsykin@virtuozzo.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 951B460381 for <patchwork-qemu-devel@patchwork.kernel.org>; Fri, 22 Sep 2017 09:41:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8239329838 for <patchwork-qemu-devel@patchwork.kernel.org>; Fri, 22 Sep 2017 09:41:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 76F212983D; Fri, 22 Sep 2017 09:41:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DAB8629838 for <patchwork-qemu-devel@patchwork.kernel.org>; Fri, 22 Sep 2017 09:41:00 +0000 (UTC) Received: from localhost ([::1]:57565 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org>) id 1dvKSB-00009F-Rp for patchwork-qemu-devel@patchwork.kernel.org; Fri, 22 Sep 2017 05:40:59 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39527) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <pbutsykin@virtuozzo.com>) id 1dvKRH-00004v-DM for qemu-devel@nongnu.org; Fri, 22 Sep 2017 05:40:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <pbutsykin@virtuozzo.com>) id 1dvKRG-0004NZ-GM for qemu-devel@nongnu.org; Fri, 22 Sep 2017 05:40:03 -0400 Received: from mail-eopbgr00133.outbound.protection.outlook.com ([40.107.0.133]:5029 helo=EUR02-AM5-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from <pbutsykin@virtuozzo.com>) id 1dvKRA-00047J-G4; Fri, 22 Sep 2017 05:39:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=Z7CiFeD+nt7m9Z/0xBrm2zSlhqEP6ubfl7fOGSrl9SM=; b=VxGH0whL6dx9IkviSr5QFG8WY1DV4eArpVZsLbblnryXEk42PJs1MU4EmY0sit3/jgRd7RpV+muQDwBz+vXMpXSpSZGUz/khrW8du+gG/o3P534e3zLgWZw9zPT23o2atMBnF84gcsD5GdH66aYeJ/nqlm4a3gUcBR6HvBTWy+M= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=pbutsykin@virtuozzo.com; Received: from pavelb-Z68P-DS3.sw.ru (195.214.232.6) by VI1PR0802MB2559.eurprd08.prod.outlook.com (2603:10a6:800:ae::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Fri, 22 Sep 2017 09:39:53 +0000 From: Pavel Butsykin <pbutsykin@virtuozzo.com> To: qemu-block@nongnu.org, qemu-devel@nongnu.org Date: Fri, 22 Sep 2017 12:39:25 +0300 Message-Id: <20170922093926.9723-2-pbutsykin@virtuozzo.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20170922093926.9723-1-pbutsykin@virtuozzo.com> References: <20170922093926.9723-1-pbutsykin@virtuozzo.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [195.214.232.6] X-ClientProxiedBy: HE1PR0401CA0046.eurprd04.prod.outlook.com (2603:10a6:3:19::14) To VI1PR0802MB2559.eurprd08.prod.outlook.com (2603:10a6:800:ae::9) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3667a7e4-e181-4224-ae07-08d5019de165 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(300000503095)(300135400095)(2017052603199)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:VI1PR0802MB2559; X-Microsoft-Exchange-Diagnostics: 1; VI1PR0802MB2559; 3:bkBtr1GIekAlp6lN/0Ghd3AEV3X2huHaWhquEOu+PxVWD2ui8A0pq0/DeSPleZVtomQVQ5Rcl5s0WTomA1pJvPsXu2xBObMTu2om1qETXZb9hz4Vf1XAV/HEdZc4k9Yx67wRrmS2EQuYsPy1BjN6pxo1k8QxRGETGvD0ukj77O/kIqaDKYOGdR3M00ImvVG1bqOa2yJqtD/qDirz99xHwPKGaMiLxMRFq9u9mUJiXuO1p4g4UUrP7iJqDFygD5cj; 25:qDbTuRvO/b0o75+y7InpUi4LFNcDgHPYjNC/qi+QXqGI6ccU3tgIxrabEHTuAENY3idFNJPDCB2DYGaJhIlj2fhJBkNVJGQx59zzB2ct2fR+PWNpE0xkwg2obf7lruhLtJwtqXaHcQsAmEJ4C4cKSK7IlOYKKxIkM4q3jKCmhX6UTIGF8RRZja4z3J1AnWqn00zJPa4kjq1rU6Yx+B37b8wucF/ORb0Pgvk6hXywuhdiFkOAJUTshAfrU+E97rcxStOmZQk+KoPjT1NgNHy9h6D/gKYFlMXznWxXQ3bGqs/MfD2Bnb9hM3gluFsQUNkAumB48lruCgpm9o6ynyUDuQ==; 31:HkcULUPZydrmGU0axny9qGbdwDLTpxtbM3SrBkfKKWZrP+vfJUjuZoKAaUTfR+opY/jJTI3WpZoEZJgFYieNqDECdAYOOcNI7+JGyPNe/f49SFsYitg+gYI5d8xlGW71tqQtu9ZUbbK+QtzDP1W3RKXJ9MCuMk1UP1etJQaeCTVVl4l5Zj078CYCil7cdmStC0qRxvWyrsW34lEYZOWt5pM7GHGaVwjtkI9Q8xPARPM= X-MS-TrafficTypeDiagnostic: VI1PR0802MB2559: X-Microsoft-Exchange-Diagnostics: 1; VI1PR0802MB2559; 20:SWYXXVdlS+YFGxHjNcM8foIhwANqol7FpqZoIgGEGEgNUxgrj+o8RjER1j3ob7o3fbwTixIghmH8QSLTVddMI7GklrTkKFQj/4pylrELwQYm/DCGv7pUKnB/O+9mU42Av7QvIWbDUS033robNFJ8zf2Wn7kZtMcozBWbKJbUZJ3jqALAXaT9pGaRK/GpMRhsiJru2b+ALPSkRKdYHpX6r4y8S4+uUrVl1i8xtahu6iHlpORiV0IfhUgVm0AG9rTTchOEdxtmVVij3mzO7BP7ckKzFHFWIdrpnghpaXqzwtAM92FeKdthE0wQhk3AI3AY/0Uf+gIb+RgFQiqt5jnelM4jUhDcD8MHaQwP3dnMXM6BJqcdD7DhWucWeALCXwO0t00D46/hvPtQfVT8mm4TCgmv7dVrR0kSlvdOo7k8+gs=; 4:4Hb4pH61P9thl8SONq4H640aRfDQa3udwpGz6t00JqRgi8YxZzVfJDrP69Ia86DHgxg87uLAhEjY5D+10Sm4dSY6ZWTqKw7ErvEbO9zn9Bp/LtxB1OrOqEFJTvj9ubFuVX41EFHRMTkADp3L77UDGYA9CQUC/PT14TMLB0sdprAlKGIPUIT30cMHoDpoxZ2TLVuMApjTpmnHRIBaKpBu9qtN/nRcZ6h1zoKU+KxXp6z3SlA8+x6pyO+bTDfTaqcB X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: <VI1PR0802MB255910432893D9C5FDE9933EAC670@VI1PR0802MB2559.eurprd08.prod.outlook.com> X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(93006095)(93001095)(100000703101)(100105400095)(3002001)(10201501046)(6041248)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123564025)(20161123558100)(20161123560025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:VI1PR0802MB2559; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:VI1PR0802MB2559; X-Forefront-PRVS: 0438F90F17 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(346002)(376002)(199003)(189002)(25786009)(106356001)(81156014)(3846002)(81166006)(66066001)(86362001)(8936002)(6116002)(105586002)(7736002)(2950100002)(5660300001)(8676002)(48376002)(69596002)(50466002)(107886003)(189998001)(4326008)(50986999)(76176999)(6512007)(36756003)(2906002)(47776003)(5003940100001)(97736004)(305945005)(50226002)(16586007)(53416004)(16526017)(6506006)(101416001)(478600001)(53936002)(6666003)(1076002)(6486002)(33646002)(68736007)(316002); DIR:OUT; SFP:1102; SCL:1; SRVR:VI1PR0802MB2559; H:pavelb-Z68P-DS3.sw.ru; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR0802MB2559; 23:HIqAX5k+ssXMiDR5bMSORUty86eFJE7QCr6DzrZ?= =?us-ascii?Q?feijDQrVucN39wjJRmzeTzHl5RmjbKtkoZ20VXA8CJFqxR/Hr8sPzzDxRBcR?= =?us-ascii?Q?BUGZ5xUvte6U8WBv7ZYRjfviEXqnrh/MBjfWm3Qf7AIyNwSzdbW2RWwKtk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tHM/GeO1F0EGUukSM9PF2MFg?= =?us-ascii?Q?85TbgtQ7C4DXUBJMJIC+DqFWDhqy5gA7Okey7R34/hKlmBWYiq4/K3D9aLxr?= =?us-ascii?Q?xgXWhqMbKk08=3D?= X-Microsoft-Exchange-Diagnostics: 1; VI1PR0802MB2559; 6:6U4KMe7MnoZnNKTPm5+vNL2bjxXY0MY2JtFuxzy/XceC24fU71Snh1WXzemkqMGAj2rVWSdFskOP+6d3EsaJOhxJo5hHKjMYXFRqYXMvlzEnVNFnB+6gYB7WWyW4g1XMzaMmfWHXJ1JPu8IUlj+rppEBf/14WPuyJOBSHurefg4hfixMu0lWEhTPj76u92DfG7pNQyUQ+hjTwxLYjiFvsFZfK4fMy6SiYxXRaND1nWW3ipTgpWCIyTv1ftg0JNrzuUVnWizDQArKvmYotDlEacJ6cXao1t1pmeeqRfdzR9vV9m294oOz3URVRJHgp3QYszWcpiNEZAM2VkEHzLd/IQ==; 5:rBVggjqJS2LxvWW4R8a7JOUUtrXY5PDO9QhEWf5OlGE7FndFHs8vSu9OwmlwKWTjpxygLz60XdJ6EV3fp/cZYaBOYFBwFqdUdyLDGJuKrPfJAFRce1v89FcejqFAMGUjsPgXAVsIfwIg3y26eqdYuA==; 24:KqS87osPzs0CVQ1/cUENh+07HQBzUMFdZJwqlWuZak+K+1U98sXgs/fs0e4DZ00kEiqoRm5zbM6ML0SRJolR1961N/du7F+ddeKyDp+XVTk=; 7:eHsc+7p75jHPHnR4D7T4GS71SUdMsnI7uEcLDSisozr+2Vbb32bl26ubLxcETWhQ1xswXCOozkuZPAC5nQIQ+opJleboKCi5wJnIliKNEykr30ScT4Zh4Oavr7V3zuLwX2fXiFPAGgkMlm6njjve7Fijo+Dr4zpOabPr3aBffz3HC8fwCATRz4+9uRRlQo6fX0il5xun9uSJaQc3/+ehUohJqWR7uveOjDUz92xFWtw= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; VI1PR0802MB2559; 20:Brsf1ULNlK+ejgrYSkNRqJ8bfNx2VqoWWS+GylMQzWg3S+ocJhcrB/e0Nq0C82DNbRKncP7qf4buFfqdkXxfppmmxk9imbq6sl4dDJTjy2gs/qVk/AtStvHG9pQ8sMORT7LkC30mUmAqZpmobU/m/ftIYM0rKZUcWbW7nLNJ1ss= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Sep 2017 09:39:53.7073 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0802MB2559 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 40.107.0.133 Subject: [Qemu-devel] [PATCH v2 1/2] qcow2: fix return error code 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>, <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>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Cc: kwolf@redhat.com, pbutsykin@virtuozzo.com, mreitz@redhat.com, den@openvz.org, jsnow@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org> X-Virus-Scanned: ClamAV using ClamSMTP |
diff --git a/block/qcow2.c b/block/qcow2.c index 2174a84d1f..8a4311d338 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -3166,7 +3166,7 @@ static int qcow2_truncate(BlockDriverState *bs, int64_t offset, if (old_file_size < 0) { error_setg_errno(errp, -old_file_size, "Failed to inquire current file length"); - return ret; + return old_file_size; } nb_new_data_clusters = DIV_ROUND_UP(offset - old_length, @@ -3195,7 +3195,7 @@ static int qcow2_truncate(BlockDriverState *bs, int64_t offset, if (allocation_start < 0) { error_setg_errno(errp, -allocation_start, "Failed to resize refcount structures"); - return -allocation_start; + return allocation_start; } clusters_allocated = qcow2_alloc_clusters_at(bs, allocation_start,