From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 2C1911FF139 for ; Mon, 12 Jan 2026 17:00:33 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id DDACE375C; Mon, 12 Jan 2026 17:00:18 +0100 (CET) From: Fiona Ebner To: pve-devel@lists.proxmox.com Date: Mon, 12 Jan 2026 16:59:26 +0100 Message-ID: <20260112155940.298273-3-f.ebner@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260112155940.298273-1-f.ebner@proxmox.com> References: <20260112155940.298273-1-f.ebner@proxmox.com> MIME-Version: 1.0 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1768233540508 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.017 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pve-devel] [PATCH qemu 2/2] fix #7197: add fix to avoid misaligned BLKZEROOUT casuing a hard error X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" After my initial upstream submission [0], Stefan Hajnoczi suggested a different approach. But that approach [1] turned out to be rather involved, some work is still needed and discussion to be had. For now, pick the initial approach as a stop-gap. [0]: https://lore.kernel.org/qemu-devel/20260105143416.737482-1-f.ebner@proxmox.com/T/ [1]: https://lore.kernel.org/qemu-devel/20260109120837.2772961-1-f.ebner@proxmox.com/ Signed-off-by: Fiona Ebner --- ...k-to-bounce-buffer-if-BLKZEROOUT-is-.patch | 36 +++++++++++++++++++ debian/patches/series | 1 + 2 files changed, 37 insertions(+) create mode 100644 debian/patches/extra/0013-block-io-fallback-to-bounce-buffer-if-BLKZEROOUT-is-.patch diff --git a/debian/patches/extra/0013-block-io-fallback-to-bounce-buffer-if-BLKZEROOUT-is-.patch b/debian/patches/extra/0013-block-io-fallback-to-bounce-buffer-if-BLKZEROOUT-is-.patch new file mode 100644 index 0000000..f71f5d2 --- /dev/null +++ b/debian/patches/extra/0013-block-io-fallback-to-bounce-buffer-if-BLKZEROOUT-is-.patch @@ -0,0 +1,36 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Fiona Ebner +Date: Mon, 5 Jan 2026 13:36:20 +0100 +Subject: [PATCH] block/io: fallback to bounce buffer if BLKZEROOUT is not + supported because of alignment + +Commit 5634622bcb ("file-posix: allow BLKZEROOUT with -t writeback") +enables the BLKZEROOUT ioctl when using 'writeback' cache, regressing +certain 'qemu-img convert' invocations, because of a pre-existing +issue. Namely, the BLKZEROOUT ioctl might fail with errno EINVAL when +the request is shorter than the block size of the block device. +Fallback to the bounce buffer, similar to when the ioctl is not +supported at all, rather than treating such an error as fatal. + +Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3257 +Resolves: https://bugzilla.proxmox.com/show_bug.cgi?id=7197 +Cc: qemu-stable@nongnu.org +Signed-off-by: Fiona Ebner +--- + block/io.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/block/io.c b/block/io.c +index 9bd8ba8431..7b1ad0996a 100644 +--- a/block/io.c ++++ b/block/io.c +@@ -1917,7 +1917,8 @@ bdrv_co_do_pwrite_zeroes(BlockDriverState *bs, int64_t offset, int64_t bytes, + assert(!bs->supported_zero_flags); + } + +- if (ret == -ENOTSUP && !(flags & BDRV_REQ_NO_FALLBACK)) { ++ if ((ret == -ENOTSUP || (ret == -EINVAL && num < alignment)) && ++ !(flags & BDRV_REQ_NO_FALLBACK)) { + /* Fall back to bounce buffer if write zeroes is unsupported */ + BdrvRequestFlags write_flags = flags & ~BDRV_REQ_ZERO_WRITE; + diff --git a/debian/patches/series b/debian/patches/series index 99d9369..88cfb9b 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -10,6 +10,7 @@ extra/0009-file-posix-populate-pwrite_zeroes_alignment.patch extra/0010-block-use-pwrite_zeroes_alignment-when-writing-first.patch extra/0011-block-io_uring-avoid-potentially-getting-stuck-after.patch extra/0012-block-mirror-check-range-when-setting-zero-bitmap-fo.patch +extra/0013-block-io-fallback-to-bounce-buffer-if-BLKZEROOUT-is-.patch bitmap-mirror/0001-drive-mirror-add-support-for-sync-bitmap-mode-never.patch bitmap-mirror/0002-drive-mirror-add-support-for-conditional-and-always-.patch bitmap-mirror/0003-mirror-add-check-for-bitmap-mode-without-bitmap.patch -- 2.47.3 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel