From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.openvz.org (mail.openvz.org [69.168.225.77]) by lore.virtuozzo.com (Postfix) with ESMTPS id 923F780027 for ; Tue, 24 Nov 2026 13:17:50 +0000 (UTC) Received: from mail.openvz.org (localhost [127.0.0.1]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 6AODGXvW026294; Tue, 24 Nov 2026 16:16:34 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6AODGXvW026294 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="GEtUo8il" Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 6AODGVGT026286 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Tue, 24 Nov 2026 16:16:32 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6AODGVGT026286 Received: by mail-ed1-f69.google.com with SMTP id 4fb4d7f45d1cf-6b897016acbso4158220a12.3 for ; Tue, 24 Nov 2026 05:16:31 -0800 (PST) X-Forwarded-Encrypted: i=2; AL+hErFL1qmz7AD0lvozCFMG/EFbn56C+eJtWkC6jlosT2ij9LJZcmmzosJ024PV4hNApoAY7I9l7g==@openvz.org X-Gm-Message-State: APuU4Z9FtnYcK+8nfkm5xKVSlVvjC16oxKEKklpwIsykEBYPWpw7cVMH v6LXMk1wJWkbdPMT6qDIYNeVBrlSjLvqpUEhpIXWzjWZ9XECfrQPsVmOmo6E7PSiCuimmNHQCSW WoNlo/onkX/p1fr1vPfeAXoUt74njUjJMeq//Urd9/My25ijgvyl82A== X-Gm-Gg: AZFdTZddhzkMCAKPHHPd+O47DyDAqO90QA1vg/AoUfWLhdd353O64F9sDrg/LOy1E1L uz6pzjuKxcop9rBXK/mk5XDveiiV3m+D275LbUhqUu7jFIGOZ3y+7MQXcbtE+7jOsmJoVfnKpGn qQLX44Cz53ZXPGG+YY9oK4dM4c1RkanPqnQB4qevo32vsRXkxQWsYuK0+7AfMGu2dGt9JtKh1ng jTn4p0lecXBUMnjUS9oIZaE+pRl0Qw8aFut/YGFQ6RseHiBSRKz+sUQLYGP3ptw+NkuGg4mCJrS Hux+OqWaqQf5HD4N0WIOPLHvdn4xxtfznPZ66JxKdIDTcjTzwuIPthhNqW+LCs4Gie2sMFnxllS B8AQmVuGXNIfeae/phA== X-Received: by 2002:a05:6402:23d5:b0:6b8:7ede:72c4 with SMTP id 4fb4d7f45d1cf-6ba37eb1dcdmr9720071a12.33.1795526191153; Tue, 24 Nov 2026 05:16:31 -0800 (PST) X-Received: by 2002:a05:6402:23d5:b0:6b8:7ede:72c4 with SMTP id 4fb4d7f45d1cf-6ba37eb1dcdmr9720027a12.33.1795526190584; Tue, 24 Nov 2026 05:16:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1795526190; cv=none; d=google.com; s=arc-20260327; b=Od5d8s/0yIB/Y1gkMNI1knWJ4wwfzVM5yWkk72vJ4419sBRgfl4pa3G9QGXjDKBQYb VJTUPNL2k0cq325lVxUe9g+wsZ+MxdJgX+9LMpLNFbmcgpxouhaoGfBACkzs7uRp7o7b ZGKgF88usGmkikhCK+jiUmCDn9JwFoB2U/ylK5ScqOsRp5zJcvic3lqV5Xjv7QbceRhY xSwJi6maZXhMWs2Zti+ljCt/BbtXurUMSsqPd5iDYkoHAYBbjGPhTZQmk6OE8/WuqE6G uEK1864/KtetwX76FJzbYcto+ikmb6jznWuHIkpKGywmoEyfUHc25jDaCVPnzqeEEFeU JftA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=message-id:date:references:in-reply-to:cc:to:from:subject :content-transfer-encoding:mime-version:dkim-signature; bh=i0nG3DrPGJ21nY3Lb1JW19xp03p98+0ziGN7MzAR0Wo=; fh=R8Ij1tcsVJY6TTUifPlSxlHAYVrwxb1uCKcqBJJHxVI=; b=ByAaf9pl5j1q+FlNS27SQB9mtITTaI+56BU163h+G5qULx20KNZo63CzDmqTtQkKtD dTs7qoTIVdefGAG3g84kFAMyLjeG+ER1jcPv36crpWfmJFfpYdPE7NTkkX8ohqnaEFyN gMgKn/mFuBRvXvvCbeLYF1+SkVQ6H2FGc1KMeqc1xexxRMayE7AI26uxQ+Rd4q/Qei9R t9OFPKogZicWc2dx0AM80aGvvhsS14Jnct9IsFona6QqmTu7hTBnfbz3uCZHRi5Mp/E6 ZpiGwMvb9ysB+87RI4roSAW23P+2JuvMmycQhjb6zE0yPe+3n1PVa00PV2UHAQrs5mpc HKXA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=GEtUo8il; spf=pass (google.com: domain of khorenko@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=khorenko@virtuozzo.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com Received: from relay.virtuozzo.com (relay.virtuozzo.com. [130.117.225.111]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-6ba37175c7esi12129475a12.116.2026.11.24.05.16.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Nov 2026 05:16:30 -0800 (PST) Received-SPF: pass (google.com: domain of khorenko@virtuozzo.com designates 130.117.225.111 as permitted sender) client-ip=130.117.225.111; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=GEtUo8il; spf=pass (google.com: domain of khorenko@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=khorenko@virtuozzo.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=virtuozzo.com; s=relay; h=Message-Id:Date:From:Subject:Content-Type: MIME-Version; bh=i0nG3DrPGJ21nY3Lb1JW19xp03p98+0ziGN7MzAR0Wo=; b=GEtUo8il8jkv hACxma5zuYobHGp6gJN2Ilzs4+Ps9y/fHalR0y+Mzhwf56BBb5pEA42hebqU1QMk24VueuHO+dakP 67xRs9s//PQgagIjImQ2GuaDYRrSnjF3yjiYcQwY1sVNDFND3FmelxWck1UE7o8NkuyrjKFgsG51X NpFiGJE9/dcwd+GKofI76YDr8gPKVBuwUGANAd8Fj9GtwLX87jLqLsNQXbRyokbTUP+/rW/rGo9n7 8npr69Gl6crgSd5NIQi8bj72VcmfvUhDGyKqc/1momAa/WqPAmaOekhNf/jeIrzO9mUZ5+n+eTtxT DWsx51Nwdw0U2jtXbKmQxA==; Received: from ch-demo-asa.virtuozzo.com ([130.117.225.8] helo=f0.sw.ru) by relay.virtuozzo.com with esmtp (Exim 4.96) (envelope-from ) id 1xVqNg-00HYBz-0P; Tue, 24 Nov 2026 14:16:20 +0100 MIME-Version: 1.0 From: Konstantin Khorenko To: "Denis V. Lunev" In-Reply-To: <20261124124613.455047-1-den@openvz.org> References: <20261124124613.455047-1-den@openvz.org> Date: Tue, 24 Nov 2026 14:16:29 +0100 Message-Id: <179552618902.15442.1907084102807179050.b4-review@b4> X-Mailer: b4 0.16.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2521; i=khorenko@virtuozzo.com; h=from:subject:message-id; bh=Qm4Z5pTkI1gcJT3B8InhZv1azflNRfhSun/XK4aNOHM=; b=owEBbQKS/ZANAwAKAVGWCkf5YVwqAcsmYgBrBY4tVqeG8r8VLmy2EF/jdByzlBO8ZW7ghN5A7 /b7phezL5iJAjMEAAEKAB0WIQRWD23IPcXT0GO9CCxRlgpH+WFcKgUCawWOLQAKCRBRlgpH+WFc KhcvEACoILt9es6So3ZsucBhiS8kCPIjrv35zRRGFoM0NeS6PhXs1c7O2M87Z+ylN2mwyf5oRLi Mmfkxx6lyZz7b4mkYY/tZAetIHxXfTlp1B0vghOKQ0sjsnCeUj4XePHLNxO5lDR4Uf4TZYRDf4V Ga02VJzMs1RQZsaUUTcjhe1yAzf822055kafPVVlXSrnbe39WUuKqwqaYfmJ6D/J4R527MzfelU 13y8vvzxMCd5B1ubOb40xhi7XcTBXf74J+8U/NEUn0WsbWTFkbinUXEfBfM60sQRzd2+msrSeaF Eos6sTfCxm/GhuJUCF+tp/RYkRJSt87WzuUoNjGHoP5Mnr/7OP3IDlwDRUkGLWEI3YAXLGcSEbx ZYHzztB4owZEfay9sY9OMdgrhraHYIfgQ8KFQ5xbITeui3VC6Scfz77WN868Shv+zIZza3j47uq /uzRgnlGquBJ4DCCsqRIJpFqc8Zs2yBupMbZtMiiHezm6QddETJHvLC9ukTDluIs+q+fHhzl3SH e8lluXBkBgFjeN07YZgENkKeYKtBOaZB/3oEktfKl9HsA3whRrprWccGYluMp5ZKaNIVSwTl/7O 1dVYpFQ/5srhtMgXb/mKosHLSwkChN83aP6lRMu+4xdYv0EnaKhFWNBOw6pPJXdRvVRo9/2uZgo 2Jh6DaJ8aFvMP/g== X-Developer-Key: i=khorenko@virtuozzo.com; a=openpgp; fpr=560F6DC83DC5D3D063BD082C51960A47F9615C2A X-OZ-Fwd: true Cc: devel@openvz.org Subject: Re: [Devel] [PATCH hci-8.2 v2] dm-qcow2: fix stale host data showing in a zero cluster after a write X-BeenThere: devel@openvz.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: OpenVZ development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: devel-bounces@openvz.org Errors-To: devel-bounces@openvz.org I won't apply this version, please send v3 with the changes below. On Tue, 24 Nov 2026 13:46:13 +0100, Denis V. Lunev wrote: > dm-qcow2: fix stale host data showing in a zero cluster after a write - Keep the unallocated subcluster case, but do not pay for it on clusters dm-qcow2 allocated itself: their unused subclusters are zero on disk already. - Commit message: split the last sentence of the first paragraph, and the subject should cover unallocated subclusters too. All four v1 asks are done, and the code is correct. The problem is the price of my first v1 ask as it is done here. > + if (!maybe_mapped_in_lower_delta(qcow2, qio)) > + mask |= ~((u32)map->ext_l2 | zeroes); prepare_l1l2_allocation() sets the alloc bits of the written subclusters only, so every cluster dm-qcow2 allocates has unallocated subclusters, and without backing data each of them now takes this path. ploop creates images with 1M clusters and extended L2 entries, so this is the default CT disk without snapshots. A 4K write into a fresh subcluster used to set the bit and go out at once, with the L2 writeback in parallel. Now it waits for a dirty L2, locks the L2 entry so all I/O to the 1M cluster waits, writes 32K of which 28K are zeroes, and completes only after its own L2 writeback. That is up to 31 times per cluster, and host holes become allocated blocks. Those zeroes buy nothing: prepare_unused_cluster() punches a reused area below file_preallocated_area_start and the area past it is fresh, and our own discard punches too. Stale data can come only from clusters qemu wrote. One way: when dm-qcow2 allocates a cluster that has no backing data, set all its alloc bits at once (the check must look at the cluster, not at the write start); then only qemu-written clusters take the COW. If you see a cheaper way, fine too, but please show fio numbers for 4K random and sequential writes on a fresh 1M extended L2 image without backing, before and after. > unit reads back the stale data instead of zeroes: > prepare_l1l2_allocation() reuses the host cluster as it is, and the > backing file COW of a write with one border in an unallocated > subcluster and the other in a zero subcluster copies only the > unallocated one. This sentence runs eight lines and joins two mechanisms with a colon; please split it. The subject still says "zero cluster" while the patch now fixes unallocated subclusters as well. -- Konstantin Khorenko, Virtuozzo Linux Kernel Team _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel