From patchwork Thu Jun 1 15:14:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Nefedov X-Patchwork-Id: 9759833 Return-Path: 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 A3EC060375 for ; Thu, 1 Jun 2017 15:22:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9556A284F9 for ; Thu, 1 Jun 2017 15:22:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8A4632852B; Thu, 1 Jun 2017 15:22:18 +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 D4EB32852D for ; Thu, 1 Jun 2017 15:22:17 +0000 (UTC) Received: from localhost ([::1]:45206 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dGRvU-0005EQ-Ul for patchwork-qemu-devel@patchwork.kernel.org; Thu, 01 Jun 2017 11:22:16 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51699) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dGRok-0000Qr-CU for qemu-devel@nongnu.org; Thu, 01 Jun 2017 11:15:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dGRoe-0004m4-DC for qemu-devel@nongnu.org; Thu, 01 Jun 2017 11:15:18 -0400 Received: from mail-db5eur01on0136.outbound.protection.outlook.com ([104.47.2.136]:6143 helo=EUR01-DB5-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dGRoe-0004jz-5d for qemu-devel@nongnu.org; Thu, 01 Jun 2017 11:15:12 -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=IzkBu0dT0RkafqbaUStSbVfX902IBprOJqOsweLPLuE=; b=Mm4lwZ2ApQhvtlLASdt9NP7zxwjYQJdseckO0sRSJcE1T9D9U+4+bsUgDTnnIini7E/KZ3DOxTH2qXLR6bzldwJjv4pkmKk0EPjpppWVzQbjS8Y74MlZIuKKJhY4ZzZG9LMn4DTOol56Wxg4aIb/Hcy23KTMfwF1TSGJ8dAVGoQ= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none; nongnu.org; dmarc=none action=none header.from=virtuozzo.com; Received: from xantnef-ws.sw.ru (195.214.232.6) by VI1PR0801MB1999.eurprd08.prod.outlook.com (2603:10a6:800:8a::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1124.9; Thu, 1 Jun 2017 15:15:10 +0000 From: Anton Nefedov To: Date: Thu, 1 Jun 2017 18:14:29 +0300 Message-ID: <1496330073-51338-12-git-send-email-anton.nefedov@virtuozzo.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1496330073-51338-1-git-send-email-anton.nefedov@virtuozzo.com> References: <1496330073-51338-1-git-send-email-anton.nefedov@virtuozzo.com> MIME-Version: 1.0 X-Originating-IP: [195.214.232.6] X-ClientProxiedBy: DB6PR1001CA0005.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:4:b7::15) To VI1PR0801MB1999.eurprd08.prod.outlook.com (2603:10a6:800:8a::20) X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1PR0801MB1999: X-MS-Office365-Filtering-Correlation-Id: 3bfb4078-cfd2-4994-c5f4-08d4a900ff11 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:VI1PR0801MB1999; X-Microsoft-Exchange-Diagnostics: 1; VI1PR0801MB1999; 3:wa13CmvdjejIc416+ghfpYTKy3twvsVEMKeXRKUiW8QjblKlECbMq6eUa2lgPwxfcfHu3DwCWpDHVUB21zxq9xbcBQtJzAqF4DvHXq5I9fkL0wHzPMMx2elS4ytRskbhGnrFXu/cqTL4I1fd82m/B+DXkxhNX4Zhpdh4RDiCVaK5fDwusMfgk5h7Sui4/OWZu7tJ6S2N2Z2AyU7Rwc98Hfv0q68ncr11416bCHn9+HfDhc214BiUGhjCkSCKu6nN2T7pdHimNt+KvHp2FIetYhllXOVQnuHvm29Cpi7OF7gF6ivQ7FS7s2SFqKwkvC4hsQDVj1mugSKlUq/5mBmKyA==; 25:zazTz13iZhIN3z0mpklnU11P6SZykaNn5x8w+9HipaSmXopzQ3//rBa41N+O7U0DLQB05p8i/smPQ4T68T8W0CR4qQCh3qjo3PLRQx5ld6HyZIbcovQ+zMRQngcpThuEZdeJpl6A3sWBVoiiGCLw5vcHTlcXkN1FrPqgbqfW+icaLYYrIfeAhoNeronVuBtARZzL0FPNjt7JFsMRubA9lBXJFYVEEtAu58R/XOCvRTRuWRyDpqIMWrJ1dbKR8PgegjrZHxqQ5Hllhy4qzJwTupWVr0F94IQAHkYjBMGkHvD8i7Q8+CXVUDuhMzG/oN1vtvqCA3efeYR2fQl+JN0fTC2RfdSzEk4ivCPRR6Ov82wvteGNhmWLBLH09cTfvQOwgmQYQ59nLbcbvHYZmTDqUk87sM5ZmDBjRlgMC/SG5MwAO/G4mwvcRCCEyWs2ulmjmJM49otn4sGsjHCLC+zkWwLLt7Um8ijgrQxULgPXB04= X-Microsoft-Exchange-Diagnostics: 1; VI1PR0801MB1999; 31:sKk1/INqBdM7dnPR11pFW2xu4Z5jzuWd0MFOsRAAJzMBBtKkCb1b/kE6DCfiQjsJeAt5Hei7B9fCO+9puqv2cLsXRu+ZTJsDziI70hzT/c0LHArT7P4qH+hApbXreK8dyOXUQ+71MmLP4/zEWqXLYCSHjjqvxmeTvTUzxHWwXBbiwZugIHZwZE1uxTEAarILQjbA37xo2645oTJ+47+ZB1b7S2L9zJZU9+dLx/zkM7A=; 20:s1vncv0m5grgt1BDCtiPrcuOSQ0UB3lHKaszTux2sv64bQS0Ibxcs8hfkzPNQLaRHYjHdKWt2DGO+vDanv5+WNY7UkwofPDh5s60LHc5PRIgQSDO1208ulJUTa1hSisMo+6C3Q+avmZvM5uNT84bLm0y+tCzwI/k4bcfFfbqQf7kOJr1/nxR1TDSfdDQPoL6C6ZTAMD51oPiUE4+QLeqaCCHDeV8mFWaG3sEurru87d7nbe2cSrh+kOkLAgaRU2QxCzg8oZts1gr9Nl/3S3Lf/apBwK0C9cY8zeY2FOvDTw1R4bJjCc94A5nysWIM2W3jNPccrTFitAC5Er5ef7i3ZTrh6EjZvRCK7HefWQa/I0xN/ODu0zJbgr+MSvVwedaeJ4OYT0JRQOuDAFVA3CgHLq9KFcPGb49xGL11mclXz0= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(100000703101)(100105400095)(3002001)(6041248)(20161123560025)(20161123558100)(20161123555025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:VI1PR0801MB1999; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:VI1PR0801MB1999; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR0801MB1999; 4:qGy14MhuBIkEROyXBb6gHomlP4xFCVktxk9dtLfW?= =?us-ascii?Q?I+GiVxWvu8RHfnWmGuwVrYofRatr2tkRtv4p2JxTK3A2wEiQMAeRGwaJ5FYX?= =?us-ascii?Q?EL1rpL0ROyXiChzVnEdUdB/AhpashmU8iwvRksSckt6pIene1UEpMXrvKiHS?= =?us-ascii?Q?Rrd9ReRnBvnTy79V1Kr6LEqf57PZWEpgWtce/Uxo2+7Eat/pYsKlty+kG7MU?= =?us-ascii?Q?EQyozqp+sWo48vB3CQcRV1pH8Sz5XFdlVk5OQPo+3oWTBfZOd6h1nS2IZrvW?= =?us-ascii?Q?vIQ6AHey+qU4DMNPAFm8DBId1lO9hz1VTNUQKhxhAZg0Tt6ZV5g1kA5EDeee?= =?us-ascii?Q?RjkVVctBe3Ve/fF8y6qVdhIKkesh3Z42xIbvimOqId5AMjUzvpiLnyCeYN+P?= =?us-ascii?Q?D0K2IUbVVgX8bymsj7WsyctT1O7fIV3b80l49FRQ7dMS6VUVFnA8O5GOwVZ0?= =?us-ascii?Q?9ZV7I5r5RTXUTUl4ozvqVzQPEu5u9ecBooj2RrD0O9WCyvFY/h116+bo3B+2?= =?us-ascii?Q?OSNFsvXS5ncnlX/AhC+/g9ErOwcRhMnGVqiFmFp0u2AiIxr4xyeQIG8EeHAg?= =?us-ascii?Q?N11yvosBe8dx4vIv6ecf7ATsfGnus4LkJeqy5eVrsnXoA/RSKicHmnAU0hHG?= =?us-ascii?Q?qKjhHaRbGOcxrejeRC5c7rowvH5edj7eGCC7blk8JlSK5CC2BD5/lkmaHqRH?= =?us-ascii?Q?+U9Z5c1ffHLBehNtYj6ljd/gSPSxT6zrvkjPgzdef2gvk15nboKhePOr6Gdo?= =?us-ascii?Q?lQDeHPl1L8OyqnNkdj5xIHHghBn5XPR/kntceuWj6q4yyb12Yot0ZeUUmb+K?= =?us-ascii?Q?o1ezCJHTH2zJxIf7WYWUfE0Vd5OrkDN8ox1Y9JA9yIzARCJQtIF0fsZpJ2Y2?= =?us-ascii?Q?dN5bE8My0bYyOeH/uwD+5Wjof4VTh1Haa6A0aa6B7BaEEaaMZUApEckRIq3m?= =?us-ascii?Q?z0ZlbiTsEV688jEV7poiRUnPvrUfr6YIjC2gLn8rL8tr5UqAbnwUSP+xmZZH?= =?us-ascii?Q?evLBhaZbPSuvWoNw4pVBJsgwlA7mRg01diYWKs1uVS2oMNc6GJEiHw95I+4l?= =?us-ascii?Q?QtWDCDSz2f/KAk9kTye8TBzYlV0CUY2PsvmxkYo6Cfq2VYzOej04skZtxM5+?= =?us-ascii?Q?jGgOfuz3yhNY+RkREY3sMVO7PXQ36TTM?= X-Forefront-PRVS: 0325F6C77B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(39830400002)(39450400003)(39400400002)(6916009)(6666003)(6486002)(7736002)(478600001)(5660300001)(305945005)(54906002)(53936002)(4326008)(6512007)(6506006)(2950100002)(110136004)(107886003)(3846002)(50226002)(8676002)(66066001)(42186005)(81166006)(38730400002)(25786009)(6116002)(76176999)(50986999)(47776003)(86362001)(5003940100001)(2906002)(2351001)(36756003)(48376002)(50466002)(33646002)(53416004)(189998001); DIR:OUT; SFP:1102; SCL:1; SRVR:VI1PR0801MB1999; H:xantnef-ws.sw.ru; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR0801MB1999; 23:ruLMGPlrPsqxrJF2OxgoU1jclCXZBASjcx9lFKL?= =?us-ascii?Q?YsqMl6sL1bQRjuV8sB327uaWsIlFFV5ZQ+Yaxtp9N0NY7hUy4hw3AKEuCqbE?= =?us-ascii?Q?zLHoJHkrAtrzxw6XEbG1rcNxOD1KsAcbJ5H5fOqO7+/sDiIty/GqZe2Tj/Or?= =?us-ascii?Q?UrY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uoUcFgCZBTSpgtIIniHYjEld9QugucKCeJtMSddGxa10Ds93g6ytgHzJXASRHQvT2CoU6g/jd0scHrZ9urMZib5ZaQtGZcnkI2; 24:EY/JK4cLUBH6tjOVamyXXcESs2cckvqBQ/FTA9PX+sB7Co0vUUt47vcJlnLHMC5dTmDa6Ij08fjziXi6dLigzNfUAmAjhRCd1efX/SsJn9s= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; VI1PR0801MB1999; 7:/iPpzZPSqYbtI4+PK5h+wBO4L3iQ7eQN2TNDocFw0u35ottzeGcCkZeG8zn3pXSP/qFPW2zrdMQ3JRvRwGw0RiwgfBGy+AzpM4vOYLXH+qy2RIrdSkxaUjRmFqypaQlNOdAJItLYul3e8YPubgws6NbG0Y4W3rjh+XpLB1bgHpeFPRaRZW1Zv+A/BW1LNbqWdeeVZnP30E4s5QfXTeSBYiE8h1ytedSmVtU8dTBXGxqbDwNNlpsNvWltlmA3Pt+wRlO5d0J9OtO+i+7jTN24+dA0WVbNKzcZiAm4hvPATuUXjt4k48KNS4Unxq0WVjBGTQMzWoHtvpbMXAgFHX17RQ==; 20:+bvQ2rLXmhn3dE/+zDhtpUDB0lhYk68dOY7l5C1soZ1pLoIF+anhH5I0qJWHQfbC+WDU+mrLp96JdIDSVWDCg77xyW8DoRFpAtTIB5sVrXqf9s+zrVaI3sulRC01et0FsS4vcL/izr/ZsKk7mnHQgQRsi99QPkqwI5NKt8Ro6zY= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jun 2017 15:15:10.1781 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0801MB1999 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.2.136 Subject: [Qemu-devel] [PATCH v2 11/15] qcow2: fix misleading comment about L2 linking X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, Anton Nefedov , den@virtuozzo.com, mreitz@redhat.com, "Denis V . Lunev" Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Anton Nefedov Signed-off-by: Denis V. Lunev --- block/qcow2-cluster.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c index ed65961..3dafd19 100644 --- a/block/qcow2-cluster.c +++ b/block/qcow2-cluster.c @@ -827,12 +827,10 @@ int qcow2_alloc_cluster_link_l2(BlockDriverState *bs, QCowL2Meta *m) assert(l2_index + m->nb_clusters <= s->l2_size); for (i = 0; i < m->nb_clusters; i++) { - /* if two concurrent writes happen to the same unallocated cluster - * each write allocates separate cluster and writes data concurrently. - * The first one to complete updates l2 table with pointer to its - * cluster the second one has to do RMW (which is done above by - * perform_cow()), update l2 table with its cluster pointer and free - * old cluster. This is what this loop does */ + /* handle_dependencies() protects from normal cluster allocation + * collision; still L2 entry might be !0 in case of zero or compressed + * cluster reusage or writing over the snapshot + */ if (l2_table[l2_index + i] != 0) { old_cluster[j++] = l2_table[l2_index + i]; }