From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.openvz.org (unknown [69.168.225.77]) by lore.virtuozzo.com (Postfix) with ESMTPS id BE22F80024 for ; Thu, 27 Aug 2026 16:10:32 +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 67RG9ItS001618; Thu, 27 Aug 2026 19:09:19 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 67RG9ItS001618 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="cGLswG1A" Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 67RG9B20001571 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Thu, 27 Aug 2026 19:09:11 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 67RG9B20001571 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-499bd779522so13063795e9.3 for ; Thu, 27 Aug 2026 09:09:11 -0700 (PDT) X-Gm-Message-State: AFuF++lkGlMSH+boL1tkeBDC8TLNnDR1x7W2sJMrnUfrZYphCDSLvdSk yp1Rw7CaUCxRu8uIO9U0fhxtN3f38X2TUrhWUtXMeSobpbojUekj9162xWi+zK1XrPgeSd219GL ME9Nb/hzJ4T/7QmVDAWqRP/piV6I5i2gH5wDKnbd3pEFo/6rKBGTB8A== X-Gm-Gg: AR+sD12qJaL9F/c/l4tpySclK06aIH61dY6u0pGFBGUPGPst357Vr1cUPrEdPtfOmb9 qiCxqlCOVFOUHTGJcFAJtVJNrZN3x5S0FIpYLFxm7wlDRRdyzbk9thGPNzvDGR8OYk+RIaez2N9 CYv0Z6CSopqDpgY+qjS7VI+AvlSPLK+VPqf/zElPhiwDRsnidAsElMYrPmlEJ/7DUIBA+3RE9kW dQKTR3e9DzojKfCeuOYt2VyopN+roFL4DP18IGoEzeJZpQAhMw+BWQrfqaY8IT8DZMw55ma4Fcr YkawnCBby/R7Fg/veWlDT8/Gb37i0Fd8WPNA1g/trdV2ae4+EhtPA2SGJisLHK19LqSZjakbWhq TwIYcfqGbiwb9ymxrYvblI3mNoqzg X-Received: by 2002:a05:600c:8597:b0:49a:252d:52f5 with SMTP id 5b1f17b1804b1-49a252d5393mr141209735e9.11.1787846951334; Thu, 27 Aug 2026 09:09:11 -0700 (PDT) X-Received: by 2002:a05:600c:8597:b0:49a:252d:52f5 with SMTP id 5b1f17b1804b1-49a252d5393mr141208435e9.11.1787846950753; Thu, 27 Aug 2026 09:09:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1787846950; cv=none; d=google.com; s=arc-20260327; b=Zq7obVsHZ31qBsErO+HVWU2U/6xR6dpN81PiLPX4T2bUIXU7pOP1OnL4yaT7K55jyw guC2Tpszb6hLoF9lgsZfvhYvjs/Dl+ZjgRyMnU3hs0yrHutoZHu/fFLI1rFizHS/NYjq Dbr9N/HfFPhYCmo/RZjMZe5aA5yr4z4+w8kiVCDe6/Xjya4WcABw81ATegZkSs2etz9r Hp3VLgUe/QxB/7B7NUv6VT97bSWtzP/fzG34GgU1fAyGpKvPUHeDaFo0x1xugIQ3BQTP IthTkpEJjgVwl1f36J6AD2SWm1ZeADvvv7yQP/VkesB3wk92ZA0G/s5I9fLBvlA8oW0G O3GQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=Xy7RThD7zHV0A5KPe8paUXi71lWAQW2VuRniyafg1hE=; fh=0/brz1B8ohImS2ERrXZY0dPGpSEyX2H6iLC7bneXJkE=; b=bDrvO5Vovgeg4K2YQq0M8zNsW1Iz3GcNSfUxI9uptJaDq1+L6tCd71SWr3XKp6CmSb tyxMOspyX9MYUCW8t3UpDeD4LP1pDkcJJyxSkCvoD8S3XPmicaJXCgzrq/A/zMHsJ/mu r1+d3UeRAWxfRf6pn9Qvw8KJ+bT27QXaLBSA+5yQZiCrtqE+U7J7Bg/xblER+6SqdWYk +YW3U2FhJQeCnN0PLEJsKShMxzIFr6vGrfXDgBF2PmB0StEjnH9JVfHPdWpVLfOZ62ex Gn0ZxDbjYvU3rNt8Wgj0X1P1OlvdFtusxbetJJkGNEixjkyvOw5Gx8oktA6bf+jKYddl UXsA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=cGLswG1A; spf=pass (google.com: domain of andrey.zhadchenko@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=andrey.zhadchenko@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 5b1f17b1804b1-49b4a09ea7bsi38490935e9.3.2026.08.27.09.09.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Aug 2026 09:09:10 -0700 (PDT) Received-SPF: pass (google.com: domain of andrey.zhadchenko@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=cGLswG1A; spf=pass (google.com: domain of andrey.zhadchenko@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=andrey.zhadchenko@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=MIME-Version:Message-ID:Date:Subject:From: Content-Type; bh=Xy7RThD7zHV0A5KPe8paUXi71lWAQW2VuRniyafg1hE=; b=cGLswG1AS6lV wbMWGLIJJQ0vWy2ZgKLwoyTf0xO7dGDr8iPyE0Hz6GtZHwwVHN9G2ySSZRjhaSLYWC8UZWPVMvrnC YgRHb07VHJez8q2DOKLNM+3Sn7aH5ZJMmtIcnMdW15cJDk5tKwx9m86Jxc/kWZ9G8r72iesdAl5uY xMz4J+Kq1xiNPs0m6fv2g1xnWe4etCA+5SMBvC//jHf+MGsL36t2pW53eK9+4VgGYeBWPIlXVFbzz KrIWzxp034BZpSLJNf9iw2B0zppXgTgg/tKnJRtV8hUGkS8iFS8Rmx91kdgjjJA4cFWqzxA4eJ/8u ygFbTvC7oci7/TgWFLNJyw==; Received: from [130.117.225.5] (helo=vz9-demens-1.aci.vzint.dev) by relay.virtuozzo.com with esmtp (Exim 4.96) (envelope-from ) id 1wzccs-00FHQJ-0D; Thu, 27 Aug 2026 18:09:07 +0200 From: Andrey Zhadchenko To: ptikhomirov@virtuozzo.com, vasileios.almpanis@virtuozzo.com Date: Thu, 27 Aug 2026 19:06:08 +0300 Message-ID: <20260827160619.303398-1-andrey.zhadchenko@virtuozzo.com> X-Mailer: git-send-email 2.43.5 MIME-Version: 1.0 X-OZ-Fwd: true Cc: devel@openvz.org Subject: [Devel] [PATCH VZ10 v4 00/11] dm-qcow2: improve discard and read-only merge handling 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 This series makes discard update qcow2 metadata and permits backward merge from read-only source images. First patch improves revert_cluster_alloc: this function didn't expect L2 entries to contain subcluster descriptions (when ext2_l2 is set). The second patch renames COW machinery to a more general 'replace entry'. Next five patches improve discard support in general: now it clears metadata and have a subcluster granularity. The next two patches support backward merge when the image we merge from is read-only. Such merges now leave the source mappings and metadata unchanged. Previously the module ignored file mode and submitted writes anyway. Last patch makes merge respect all metadata-zeroed blocks. For now it is writing zeroes as data, but we will improve this to metadata when we support REQ_OP_WRITE_ZEROES. v2: - patch "update metadata on subclusters discard": expand qio_discard_updates_metadata() condition to return true when backing file is present and fully covered sublcu zero bit isn't already set. prepare_cluster_discard() already handled this case but I forgot about it here. v3: - add new "drivers/md/dm-qcow2: do not attach a bvec to discard qios" patch which ensures discard qios do not have garbage bvecs. Otherwise COW operations before discard may use these them. Following patches move discard above COW and alleviate this problem, but let's be explicit. - various commit message and code formatting fixes, but nothing serious v4: - swap 'allow shared L1 entries during merge from RO image' and 'do discards during backward merge only for writable image' position in a patchset. Otherwise we will need to add/remove a guard against merges from image with snapshots. - set new_ext_l2 to 0 from the beginning in 'set L2_READS_ALL_ZEROES after some discards'. Full cluster discard is expected to clear all allocated bits in ext_l2 too. Andrey Zhadchenko (11): drivers/md/dm-qcow2: do not attach a bvec to discard qios drivers/md/dm-qcow2: fix revert_cluster_alloc() for ext_l2 case drivers/md/dm-qcow2: generalize COW index update machinery drivers/md/dm-qcow2: update metadata on whole cluster discard drivers/md/dm-qcow2: never trigger COW or allocation on discard drivers/md/dm-qcow2: set L2_READS_ALL_ZEROES after some discards drivers/md/dm-qcow2: update metadata on subclusters discard drivers/md/dm-qcow2: unmap cluster when discard clears last allocated subclusters drivers/md/dm-qcow2: allow shared L1 entries during merge from RO image drivers/md/dm-qcow2: do discards during backward merge only for writable image drivers/md/dm-qcow2: respect zeroes during merge drivers/md/dm-qcow2-cmd.c | 21 +- drivers/md/dm-qcow2-map.c | 415 +++++++++++++++++++++++++++-------- drivers/md/dm-qcow2-target.c | 2 +- drivers/md/dm-qcow2.h | 19 +- 4 files changed, 351 insertions(+), 106 deletions(-) -- 2.43.5 _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel