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 5FD9180726 for ; Thu, 8 Oct 2026 17:03:28 +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 698H2ESf026198; Thu, 8 Oct 2026 20:02:15 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 698H2ESf026198 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="trFemrWl" Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 698H26xP026176 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Thu, 8 Oct 2026 20:02:06 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 698H26xP026176 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-49febef74e3so7123565e9.0 for ; Thu, 08 Oct 2026 10:02:06 -0700 (PDT) X-Forwarded-Encrypted: i=2; AKwUvBy1bKHxbe2dwCdDXy+GaD0QkBK5lTg13zUSdM3lIsFU6s0k8OMxwox6TcX/SOpHY4369b/48A==@openvz.org X-Gm-Message-State: AFuF++mtBXeSe/pbCDHSNzghmBogfEEQZXMaQDmRx+cFTLdfZG9Y1aFb WCqqYMPyQz0dsuEvL1ERxNUN2H/sOslyZalBxvlLy+Px5STyGWT5IL2fkRprOibxZFauaaPNnXB 3vjXgU4cO2DWSZp4Efxwjx+Ht/T/1kMPmNAuPe3SM1OyWV/wEUwq0ng== X-Gm-Gg: AYBFou3augLoyY82U/dhG2u9tZzBFxSvz+loxN3XBmO/D3ctF4RK7GZm6BI7HmgnzYW Hjv3LEVh64Nfel5udskSHVgGHXe8yaAC4TpVwOxchujKI7fzjU1EnKCQy7CvtfCJtOBdKhMXy5E kAOLg/9sF+4JT8j8cbTfkOd0PMIvDWUEnfvl3It2BH4Vpzy3Z4NB7oOzZcnCs3sXANSPmOczA/5 4IedyFGfujNJ/NAo1SnoHeoXZKyf7UkLQD/35/UAeAIPdz/3hJNUgcS8S4iV4j2g+xOcme9Vgrx qb3if/2vkJ8gbbPKr6VCI0D1BaZngG+H3XL/wb6VkW3YHFCHxjr/wWgxuxce1HFrLvzYL89yr/k isBSSg/tWnGzjrkuKtPs46bA8EBY= X-Received: by 2002:a05:600c:19d0:b0:4a1:7d43:3225 with SMTP id 5b1f17b1804b1-4a1852ed047mr64945745e9.4.1791478925867; Thu, 08 Oct 2026 10:02:05 -0700 (PDT) X-Received: by 2002:a05:600c:19d0:b0:4a1:7d43:3225 with SMTP id 5b1f17b1804b1-4a1852ed047mr64944195e9.4.1791478924708; Thu, 08 Oct 2026 10:02:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1791478924; cv=none; d=google.com; s=arc-20260327; b=oXVd0OuJFEGJHxSadE6aGit+PUM6vbr8pdtH3fcgoyukpUIc6vEdrul666Ze+lu7Rf JtnndrqE2lA0q8mwLUiekZ4au5xZdWXSa0Lo7W1a3D7Gl0UFQsLSuyZV9jcxUqXYdt3m vZjzk64G7h/4SQ8Jhx/hhOI+RJSajAPZ6C0jjvT+Q0DIPOCQ3yOH6DMo8xoY3qsNcQve 4CWaLqxpYnqD+1AUKm0DuL0rs7WlSTuLwte6f9Dz44ytgJ20IbDc2E+rKpI6+cUNmCya W6IgefDM+Y2rTXShIrf9A0ueXDzFAcXrj0PPNIOiHwYeAhmoC+JUScCVznGUL+x194lJ qOAA== 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=0WBx7hoMQ2yozYscabC7eJMw1RTxkdI6k4OFYQWyL/4=; fh=jiFD8gjZllyls1UFJ+1kA4uyOnjRU7bVpV3P+S6CTV8=; b=SaQkXA3xuUqiSdiTNXkAAqk07DVG08gqCGp1JvI5NnBT8WC3wku0QvG5tG4Ts5ev0O jwKScGDK4vcIkD+J2GENKwEeEu0aVNuu87Enkb9vPXyc+cTMLoDfu/pW+wx5vyiMeeYl NiV7MUayz+saSDPeBdLXxgyrU86MT8QSgVYNynlmxEUIFRhi07az8O5Si+kz6RPLVUc3 xlIy4HM6QZ9ghW//KkEOeTCQmlE8le5nTwQ+S3J8djInrxrudOFkh0uvC3eQ3oA1wDyT r3VA/01o37TsJKIasbYOy8k26/zQy0/NLHLpHbMe5tuHQ5RYbzMM3Q1w+SH/QkEBZZJD uG1g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=trFemrWl; 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-48db659a4absi467774f8f.504.2026.10.08.10.02.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Oct 2026 10:02:04 -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=trFemrWl; 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=0WBx7hoMQ2yozYscabC7eJMw1RTxkdI6k4OFYQWyL/4=; b=trFemrWlygtx Xv/O+BWroJ4DoWgOjkU6PPjObA5tg+/T6MJyNlRIvmCORKzLuH1ajvzZ5WLuB4IoH+o6uPP0kU+mo LmaHr7CU0MWyGWNOm7dpVfe8+p959MmtjmTcWPRaCdAQSOmJGPnFCwjQpse9FVgFr1+zecrQ16Xeg 8O//IqOrOoK4yqzlq78IV/Gbb4+iSX+dyqdDdRn4/kz1JWvTNZsQa+3ASzOlRcJdAzFPBb5To6Rw3 l8F2UvoipTYJ+8ZaPSg3P0paM2xAdDoq6EPkOCUkTAbRg8ae36OiF/Biwddde4JqjlEjT7x7US5yI vqrHwZlk6sDpRskvDmD4Iw==; 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 1xErS2-000z63-2R; Thu, 08 Oct 2026 19:02:00 +0200 From: Alexander Ivanov To: den@openvz.org Date: Thu, 8 Oct 2026 19:01:57 +0200 Message-ID: <20261008170200.646208-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 v4 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 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