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 713631FF146 for ; Tue, 12 May 2026 17:38:36 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 34E0819767; Tue, 12 May 2026 17:38:34 +0200 (CEST) From: Fiona Ebner To: pve-devel@lists.proxmox.com Subject: [PATCH qemu] add fix for regression when using fuse export for EFI enroll Date: Tue, 12 May 2026 17:37:20 +0200 Message-ID: <20260512153756.311383-1-f.ebner@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: 1778600167272 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.009 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 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: S4TBFFXPYRTB6ZFOQDSRA35MXSV6TIRJ X-Message-ID-Hash: S4TBFFXPYRTB6ZFOQDSRA35MXSV6TIRJ X-MailFrom: f.ebner@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: The virt-fw-vars binary for EFI enrollment opens the target file with O_TRUNC when writing the result and this caused issues since QEMU commit a94a1d7699 ("fuse: Manually process requests (without libfuse)"), because the FUSE_ATOMIC_O_TRUNC FUSE flag was implicitly dropped. Restore the flag to avoid the regression. Upstream discussion: https://lore.kernel.org/qemu-devel/9be52b33-9a28-41ca-896c-a41b5558864c@proxmox.com/ Signed-off-by: Fiona Ebner --- ...e-fix-regression-with-block-device-e.patch | 36 +++++++++++++++++++ debian/patches/series | 1 + 2 files changed, 37 insertions(+) create mode 100644 debian/patches/extra/0013-block-export-fuse-fix-regression-with-block-device-e.patch diff --git a/debian/patches/extra/0013-block-export-fuse-fix-regression-with-block-device-e.patch b/debian/patches/extra/0013-block-export-fuse-fix-regression-with-block-device-e.patch new file mode 100644 index 0000000000..121e5712cd --- /dev/null +++ b/debian/patches/extra/0013-block-export-fuse-fix-regression-with-block-device-e.patch @@ -0,0 +1,36 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Fiona Ebner +Date: Tue, 12 May 2026 17:16:23 +0200 +Subject: [PATCH] block/export/fuse: fix regression with block device export or + growable=off and O_TRUNC + +Before commit a94a1d7699 ("fuse: Manually process requests (without +libfuse)"), libfuse was used which set the FUSE_ATOMIC_O_TRUNC flag. +After the commit, the flag is not set anymore cause a regression where +opening a block-based export with O_TRUNC fails with EOPNOTSUPP. And +it also causes a regression with file-based exports, since they would +be truncated upon opening with O_TRUNC, but then subsequent writes to +the file would not be possible, since it's not growable. + +A proper upstream submission might want to conditionalize on having +growable=off and/or a block device based export for setting the flag. + +Signed-off-by: Fiona Ebner +--- + block/export/fuse.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/block/export/fuse.c b/block/export/fuse.c +index ef381fd844..7a7386c904 100644 +--- a/block/export/fuse.c ++++ b/block/export/fuse.c +@@ -816,7 +816,8 @@ static ssize_t coroutine_fn GRAPH_RDLOCK + fuse_co_init(FuseExport *exp, struct fuse_init_out *out, + const struct fuse_init_in *in) + { +- const uint32_t supported_flags = FUSE_ASYNC_READ | FUSE_ASYNC_DIO | FUSE_INIT_EXT; ++ const uint32_t supported_flags = FUSE_ASYNC_READ | FUSE_ASYNC_DIO ++ | FUSE_INIT_EXT | FUSE_ATOMIC_O_TRUNC; + const uint32_t supported_flags2 = (FUSE_DIRECT_IO_ALLOW_MMAP >> 32); + + if (in->major != 7) { diff --git a/debian/patches/series b/debian/patches/series index 39da6dff13..602d1a8eee 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -10,6 +10,7 @@ extra/0009-target-i386-fix-strList-leak-in-x86_cpu_get_unavaila.patch extra/0010-target-i386-fix-missing-PF_INSTR-in-SIGSEGV-context.patch extra/0011-migration-vmstate_save_state_v-fix-double-error_setg.patch extra/0012-block-export-fuse-fix-regression-when-mmap-ing-expor.patch +extra/0013-block-export-fuse-fix-regression-with-block-device-e.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