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 26BA1802A5 for ; Thu, 8 Oct 2026 10:06:29 +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 698A5Fbg022717; Thu, 8 Oct 2026 13:05:16 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 698A5Fbg022717 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="ThQvWz5s" Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 698A4vMe022684 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Thu, 8 Oct 2026 13:04:57 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 698A4vMe022684 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-4a1721559b4so39390005e9.1 for ; Thu, 08 Oct 2026 03:04:57 -0700 (PDT) X-Forwarded-Encrypted: i=2; AKwUvByqqs0fb6Cj0DU6JKuZU6HpFOWe5N2Tmhf7Bt4qQjIRzx8cAh2xyVo8fqJimG9+Ffm4Uy7aFw==@openvz.org X-Gm-Message-State: AFuF++lHfxeRaJFY/lCN77PT4mJwio6Efm1opddRAAbnnHK09UACI6Jd PJCArUC4QMcZLsqgaA2eE3IVLedtIG6xJhoeBgpWj0HPK2O6374XeyO7kkRUKJWRBhdPcqpPEbW 4G8zwx8sZTYS1WNU/q6Wc0DctNda7jqJ16fQj/vR120LBOZaYzTXsmg== X-Gm-Gg: AYBFou1s5DsRGVIqhxSNt+B+1fQIQnbfVC/8QYkBeI9uZyOHM0aynxfAs0baVHPD8hg OqgKjiFo2By+9zuz0DbxY7FSXrfL0xvFheTICAzN5b/JxSsCL4yUBTm7HppbAnkvxJk1CgKcd37 iNIo5ww9QImQmYMMtQvwTrKQUe+8r/yYSGWZk1K21LKLERZ/6Hj3ZpZjue/swpQQMN8WS0S3NF0 iCVmMLFCvMA6gLof7iVqAV85/TN6eeqsP/wsuJJnUUlEOqYZjyAg/mYOmplqse0SqR84KzO08ak iPiRh0TZthKcDFyfVatjzKV3xAR1vFYJt1YrXxKt06YCzryBjbyr5AOQ7hD5CoUVEwSA/tXt5wD iqziMMVghS+pEneX83SVKZ/tfpPE= X-Received: by 2002:a05:600c:1e17:b0:49d:2562:d670 with SMTP id 5b1f17b1804b1-4a180310dc1mr90145255e9.14.1791453896954; Thu, 08 Oct 2026 03:04:56 -0700 (PDT) X-Received: by 2002:a05:600c:1e17:b0:49d:2562:d670 with SMTP id 5b1f17b1804b1-4a180310dc1mr90144535e9.14.1791453896230; Thu, 08 Oct 2026 03:04:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1791453896; cv=none; d=google.com; s=arc-20260327; b=qYSu2vu6PMRsfm3agWl5txLqztV5pU5IFhcI6klUVBnyy8aUTyJLgq9LAbWx0kqt/L zEcp2ZSehUZJmSW2OPwmeB159a31x6ibuYUmvHNYEFHO2z5llmwvgEMEB4XcYQNTRfvE R1AOUiaQ8MHdUp10qRb9lFKaDOEgw1vOSRW/VWxtTX2duf6A4W08erVgHujs9eD6xik5 614Yi/WipUrb4jv5peAF5JJCUWJH8WJXdXnlS7Ycsy+6VIX5nmqI6UlQwXRISGR04nMs seyky3K7pb48UxONEJOLDc7ec3Un9e7R4Zn13D6/sMIFx4a0KO6x0p6C1r/irstludAu Srwg== 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=GjPlVxJvXOcczuPqHk+THSkqWUu5bp8yGOL81+vtqMY=; fh=jiFD8gjZllyls1UFJ+1kA4uyOnjRU7bVpV3P+S6CTV8=; b=QlXjpG1E9NXcAFIEQCHlKfkMdFKsq87ibTruPZB6EXCCeAoQtvslXwn1yFopTElPPp BxHMZW4qAYSmucvXPcVTh3ma/PjECmSkR3XncdUvdrHvzZR8N1AMg0xNSoJaS4ckaac/ I4sfYLRV1z5os3MsLD7YdZ/neR59NiZUlaNSlgQHXnZyHTXEEuZMC0F0gzgpvCw6+N2j t8neAtPj/T9L1w3PvSMNy/L424lvINnTAObgn3r988Pcdf4a4g7lMNxVy2+bd6MT/yyR Ng7jf8pcUCnyVlLGeSlCK+68AlPDfhjq4t9QaogdUdNhNY5JmNcG5+QWWlyTOefbK4Tg pqWw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=ThQvWz5s; 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-48c72486b63si9076391f8f.261.2026.10.08.03.04.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Oct 2026 03:04:56 -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=ThQvWz5s; 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=GjPlVxJvXOcczuPqHk+THSkqWUu5bp8yGOL81+vtqMY=; b=ThQvWz5seKPp 3EROJiOyd+bJUlStwmJD1n7AtuCnpgEbXhOrnSVIQdPBr8bnycWQOoD/kZn+aBYO/aSSaiJ+NOp+Q t/ZQBmXL2w7Fq+EP34hQsC5iJx8VPgv6W0TSmN6RG9V+qh1ST+Gn0V0YFKSIQ1wQp+8ysU4QOn6wo wduJaUfTsP0RUH1MXyAEY9R56FzvZbG784FiVCqpNxKNZ8I+zn512LKKsajFd5/GviQXXNMUazWI3 dXhIlg2TuXrTFa6Kps6FoRcoeEAIDbVJ4NE2jphBy1lN+ZTfr5cMiaBM+atL0SrTOekDIJSKw5RI6 kDOuw/TblnokcDTy+8rIbQ==; 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 1xEkwM-00Aash-0L; Thu, 08 Oct 2026 12:04:51 +0200 From: Alexander Ivanov To: den@openvz.org Date: Thu, 8 Oct 2026 12:04:46 +0200 Message-ID: <20261008100449.550882-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 v3 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. 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 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 | 78 ++++++++++++++++++++++++++---------- drivers/md/dm-qcow2.h | 3 ++ 3 files changed, 116 insertions(+), 21 deletions(-) -- 2.53.0 _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel