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 7C4C280958 for ; Sat, 10 Oct 2026 12:48:11 +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 69ACkovT021930; Sat, 10 Oct 2026 15:46:51 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 69ACkovT021930 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="MhCcILuf" Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 69ACknIU021915 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Sat, 10 Oct 2026 15:46:50 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 69ACknIU021915 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-48c427421f6so371206f8f.2 for ; Sat, 10 Oct 2026 05:46:50 -0700 (PDT) X-Forwarded-Encrypted: i=2; AKwUvBxL7Qr0/pB2/JB++WSP66iG23yNt1IpvA4jA4JANuHdvJYTUGfRRZwnoofX/C+rbWdc6yul8w==@openvz.org X-Gm-Message-State: AFq9FYKdx+Zvqtt4ZJXA4vQ0uRl5tcZywPjvdiueXklyuOGaNEdrPyaI jJ7xtiip1i3K5zU4pT0eeujRAhiNJHxMXx8GzmO+E04Ovpakenu8HawGfuPrdnDvO5PGL91sE5B Zeqle886LsXPmkggEPL+jj9N6H7oiJEY1+CpfQR9nfrkPH3QGef05OQ== X-Gm-Gg: AYBFou0rUL2PgNhcwdIUQBICpfO7unr7lv6HMRzXm4LVTap5qd5Bk1KhebNUw0wiLyn Tdzo5Yv7VLo8nZEwRZPMj7PDfmr/O7EE0zmomwVDmSw0W5aOTSvl8lDnivdV38tGoyHDe5aSDG+ yFIh+5C8skn+jWY6BxLMtZQZVzvPTEPWZb0gay3aMxjKiRf4zj52SSi9Oj+7av8pfWVVkNwibf+ Ws4u8K4YUT4RyjnyCFf+aeFR1KGSjewN9Mvb6w4jQZ2ldnl6dkabcsW0N9dxSOdpVR+kpmNQqjJ TJY/qaQxZGcwb6djk7J/0q98L2BerTbiyBknywm+fjULylK7+fhCe8n1OEWIQ8ldUDrb+xlabAl XPv7xmIovTTvYj58h+2lvlremIIk= X-Received: by 2002:a05:6000:1787:b0:488:6561:b324 with SMTP id ffacd0b85a97d-48dba9bdb31mr8203217f8f.9.1791636409696; Sat, 10 Oct 2026 05:46:49 -0700 (PDT) X-Received: by 2002:a05:6000:1787:b0:488:6561:b324 with SMTP id ffacd0b85a97d-48dba9bdb31mr8203209f8f.9.1791636409139; Sat, 10 Oct 2026 05:46:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1791636409; cv=none; d=google.com; s=arc-20260327; b=HezWWmB1cpBhSW15CQBXmHzKzZJO9YTuyiXyJKcM+CldktSLrmdlwJglkBxdSqoWTG mBEGGiJIKnDuCZcARaw4Pot9XqkruY4v6yKAC15RkivbIPwklF0RHeQvee70VYBRP8h2 opJQpNjFaz+nihuGjpnu7q1kfKthv6I3hApYqPmxV34n6HWo5cmj5/cmkVBPuWxMgc+o X09bQlJuXm92bqFF+B1ompJzAVl7f2UNer1wmmOr01lyCKu86BtKEFIONb3Hj6qb+ARC VTwbgtvAjt84l9Q1UeLlWyx2oSnXWultFRrovLLBgLvR2pj0MPGIig68saNZxEpp2Gl5 oD5g== 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=4LNs4dnz+W3INJVZfGtJLfTjj7qy8Kd9J4gR+o4u1xk=; fh=jiFD8gjZllyls1UFJ+1kA4uyOnjRU7bVpV3P+S6CTV8=; b=YDXAM5JZS8JJTAdSRO4o3WoiK4bCwIBrAr223QL0AuZ/ZMiE0YtZz/RjQcLhucIkBq K2BIRVU4oTzK7uLfJBCfJy8AD6gFtMhTVoAvp0QmzuF9Vj+gixgWCh3jXBPahD+1+IXH 6BHu3/cUpCllc3nGZXKHvAJAdcTbqIIgiV4NSBWVZGrMe5NvFWTm93IDDsp+BDpdVFNg h4Yp4toC22OyUcMVknJyjkbSofuTgNpUNUnHXXqgkNqTBL2WjI3TC4ksjLXWVCIlRhyz cOj/cc3YuYDDRBvWxwwnX8418GnekeR+00vR0EB7mB9dlkvzMNCxNz8sOshZ9a8j06Z4 L5Dw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=MhCcILuf; spf=pass (google.com: domain of alexander.ivanov@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=alexander.ivanov@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 ffacd0b85a97d-48dc1407e13si6043674f8f.306.2026.10.10.05.46.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Oct 2026 05:46:49 -0700 (PDT) Received-SPF: pass (google.com: domain of alexander.ivanov@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=MhCcILuf; spf=pass (google.com: domain of alexander.ivanov@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=alexander.ivanov@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=4LNs4dnz+W3INJVZfGtJLfTjj7qy8Kd9J4gR+o4u1xk=; b=MhCcILuff3DJ IHGySH4a0zUdR/YC1xBAVM/F8NLS9w84zZ3GnQdA0GYklwFgxckoHwATfpIeV28ZNPqvPuYU84zlt LTn+YXv8WzunIgzJhqegBNU0vH6zEFf8scpvwQHZ8Yw8lmHIivT20YfkdGLDNmXg7Lul3c3ZG+IWl nzBtNCjovInCt3pGayJQQDsjLguhXN9jXkmVkzHMEsh6m/evjg9Hc3wgLGf1w4a7dsSUCOLcl/qnf cqe0baYc/qyrZD99U4jS4iT1Fa5m5bwNhhAifWuYC+YMxSC/4fOwqZSLstcw4zBLPCplYmcZUPerd 1bPUxLS+1ywoM3lSgeaOUw==; Received: from ch-vpn.virtuozzo.com ([130.117.225.6] helo=sky) by relay.virtuozzo.com with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1xFWQ5-00G6FQ-1w; Sat, 10 Oct 2026 14:46:43 +0200 From: Alexander Ivanov To: den@openvz.org Date: Sat, 10 Oct 2026 14:46:39 +0200 Message-ID: <20261010124642.927044-1-alexander.ivanov@virtuozzo.com> X-Mailer: git-send-email 2.53.0 MIME-Version: 1.0 X-OZ-Fwd: true Cc: devel@openvz.org Subject: [Devel] [PATCH hci-8.1 v5 0/3] dm-qcow2: truncate unused tail of image on suspend 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 On postsuspend dm-qcow2 truncates the image file only down to file_preallocated_area_start, so clusters at the end of the file freed by discard are never given back and the file never shrinks. This series makes postsuspend scan the refcount blocks backward and truncate the file to the end of the last used cluster. Close and reload to RO go through postsuspend too, so the tail is given back in these cases as well. Patch 1 adds qcow2_md_page_read_sync() helper, which is needed by the scan. Patch 2 is a small cleanup of duplicate prefixes in QC_ERR/QC_INFO messages. Patch 3 does the actual truncation. https://virtuozzo.atlassian.net/browse/VSTOR-148171 v5: - Add Reviewed-by line. v4: - Patch 1: document in the comment that the caller must ensure no read of the page is in flight. - Patch 3: say in the commit message that close and reload to RO go through postsuspend too. v3: - Split from the common series with dm-ploop: dm-ploop patches are sent as a separate series. - Patch 1: rename qcow2_get_md_page_sync() to qcow2_md_page_read_sync(), reword commit message and comment. - Patch 2: new patch. - Patch 3: start the scan from file_preallocated_area_start instead of the end of the file and clamp the result to it, as the last cluster may be partial; print the scan error with %pe and drop the duplicate "dm-qcow2:" prefix from it. v2: - Add dm-ploop support (patches 3-6), as requested in v1 review. - dm-qcow2: move get_md_page_sync() to a separate patch as qcow2_md_page_read_sync() and use it in qcow2_parse_header() as well. - dm-qcow2: start the refcount scan below file_preallocated_area_start instead of the end of the file, and truncate to the used end directly instead of min(file_preallocated_area_start, used end). Alexander Ivanov (3): dm-qcow2: add qcow2_md_page_read_sync() helper dm-qcow2: drop duplicate prefix from QC_ERR/QC_INFO messages dm-qcow2: truncate unused tail of image on suspend drivers/md/dm-qcow2-map.c | 56 ++++++++++++++++++++++++ drivers/md/dm-qcow2-target.c | 83 +++++++++++++++++++++++++++--------- drivers/md/dm-qcow2.h | 3 ++ 3 files changed, 121 insertions(+), 21 deletions(-) -- 2.53.0 _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel