public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Fiona Ebner <f.ebner@proxmox.com>
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	[thread overview]
Message-ID: <20260512153756.311383-1-f.ebner@proxmox.com> (raw)

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 <f.ebner@proxmox.com>
---
 ...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 <f.ebner@proxmox.com>
+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 <f.ebner@proxmox.com>
+---
+ 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





             reply	other threads:[~2026-05-12 15:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-12 15:37 Fiona Ebner [this message]
2026-05-12 21:51 ` applied: [PATCH qemu] add fix for regression when using fuse export for EFI enroll Thomas Lamprecht
2026-05-13 12:36 ` Lukas Sichert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260512153756.311383-1-f.ebner@proxmox.com \
    --to=f.ebner@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal