From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id EF9BC1FF0B7 for ; Fri, 13 Nov 2026 02:28:13 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id EEF6421777; Fri, 13 Nov 2026 02:27:13 +0100 (CET) From: Thomas Lamprecht To: pve-devel@lists.proxmox.com Subject: [PATCH storage 0/3] lvm: fix qcow2 images outgrowing their LV Date: Fri, 13 Nov 2026 02:17:22 +0100 Message-ID: <20261113012702.864671-1-t.lamprecht@proxmox.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1794533227539 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.253 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: DDAW37MXQ42HGRI2Z4IYK6DFOBVVRWAV X-Message-ID-Hash: DDAW37MXQ42HGRI2Z4IYK6DFOBVVRWAV X-MailFrom: t.lamprecht@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: There were reports of qcow2 images on LVM storages with snapshot-as-volume-chain growing beyond their LV, which pauses the VM with an ENOSPC I/O error. One likely cause is deleting the oldest snapshot while the VM is stopped. FWICT the plain 'qemu-img commit' used for that drops preallocated clusters of the base image wherever the overlay holds zeroes, and guest writes to these ranges can later allocate past the end of the LV. So the first patch sets 'discard-no-unref' for that commit, as already done for running VMs and 'qemu-img convert' in qemu-server's a3a9a2ab ("fix #6543: use qcow2 'discard-no-unref' option when using snapshot-as-volume-chain"). The second patch makes resize measure snapshot overlays with their own cluster settings and the third patch reserves extra space needed for persistent dirty bitmaps, for example from Veeam, which were not explicitly accounted for in all cases and could fail to be stored for some image sizes. Tested on a scratch LVM volume group by driving allocation, snapshot, snapshot deletion and resize through the plugin, with qemu-io emulating guest writes and bitmap stores. Thomas Lamprecht (3): lvm: avoid qcow2 images outgrowing their LV after offline snapshot delete lvm: qcow2 resize: size the LV for the cluster settings of the image lvm: qcow2: reserve LV space for persistent dirty bitmaps src/PVE/Storage/LVMPlugin.pm | 50 +++++++++++++++++++++++++++++------- 1 file changed, 41 insertions(+), 9 deletions(-) -- 2.47.3