All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hanna Czenczek <hreitz@redhat.com>
To: Fiona Ebner <f.ebner@proxmox.com>, qemu-block@nongnu.org
Cc: qemu-devel@nongnu.org, Kevin Wolf <kwolf@redhat.com>
Subject: Re: [PULL 17/28] fuse: Manually process requests (without libfuse)
Date: Fri, 8 May 2026 15:13:27 +0200	[thread overview]
Message-ID: <d5c3d3da-5102-4bdc-87bc-9733fb0cbf09@redhat.com> (raw)
In-Reply-To: <8ec42109-4123-4cc7-a55e-9aa2576a791c@redhat.com>

On 08.05.26 15:06, Hanna Czenczek wrote:
> On 08.05.26 13:55, Fiona Ebner wrote:
>> Dear maintainers,
>>
>> Am 10.03.26 um 6:37 PM schrieb Kevin Wolf:
>>> From: Hanna Czenczek <hreitz@redhat.com>
>>>
>>> Manually read requests from the /dev/fuse FD and process them, without
>>> using libfuse.  This allows us to safely add parallel request 
>>> processing
>>> in coroutines later, without having to worry about libfuse internals.
>>> (Technically, we already have exactly that problem with
>>> read_from_fuse_export()/read_from_fuse_fd() nesting.)
>>>
>>> We will continue to use libfuse for mounting the filesystem; 
>>> fusermount3
>>> is a effectively a helper program of libfuse, so it should know best 
>>> how
>>> to interact with it.  (Doing it manually without libfuse, while doable,
>>> is a bit of a pain, and it is not clear to me how stable the "protocol"
>>> actually is.)
>>>
>>> Take this opportunity of quite a major rewrite to update the Copyright
>>> line with corrected information that has surfaced in the meantime.
>>
>> a colleague ran into another issue with a fuse export, this time in 
>> combination with virt-fw-vars and bisecting points to this patch. 
>> Before commit a94a1d7699 ("fuse: Manually process requests (without 
>> libfuse)") the reproducer [0] completes successfully, after that 
>> commit it hangs at [1]. The issue is still present with current 
>> master. I can dig into the details next week.
>
> On my system, virt-fw-vars opens the file with O_TRUNC (after “INFO: 
> writing raw edk2 varstore...”). It then tries to write to the file, 
> but this returns a short write because the export is not marked as 
> growable, and for some reason, the write is infinitely retried instead 
> of aborting on ret=0 (which should indicate ENOSPC for writes).
>
> Using growable=true makes it work.  (For me :))
>
> For some reason, before said commit, libfuse just did not pass that 
> truncate on. I’ll look into why exactly, but so far I would say the 
> FUSE export behavior is as I would expect it.

Ah, I see. libfuse sets FUSE_CAP_ATOMIC_O_TRUNC, which has O_TRUNC be 
passed on as an open option, but the old export code just ignored all 
open options.

The new code does not set that option, so O_TRUNC is executed as an 
explicit truncate by the kernel, which then *is* executed.

I’m not entirely sure how we should handle it. There is a case to be 
made that with growable=off, it may make sense to ignore O_TRUNC (which 
requires turning on FUSE_CAP_ATOMIC_O_TRUNC again and then continue to 
ignore it). But on the other hand, O_TRUNC is O_TRUNC, and growable=off 
does not explicitly mean “please behave as much as a block device as 
possible”.

What do you suggest?

Hanna



  reply	other threads:[~2026-05-08 13:14 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-10 16:25 [PULL 00/28] Block layer patches Kevin Wolf
2026-03-10 16:25 ` [PULL 01/28] fuse: Copy write buffer content before polling Kevin Wolf
2026-03-10 16:25 ` [PULL 02/28] fuse: Ensure init clean-up even with error_fatal Kevin Wolf
2026-03-10 16:25 ` [PULL 03/28] fuse: Remove superfluous empty line Kevin Wolf
2026-03-10 16:25 ` [PULL 04/28] fuse: Explicitly set inode ID to 1 Kevin Wolf
2026-03-10 16:25 ` [PULL 05/28] fuse: Change setup_... to mount_fuse_export() Kevin Wolf
2026-03-10 16:26 ` [PULL 06/28] fuse: Destroy session on mount_fuse_export() fail Kevin Wolf
2026-03-10 16:26 ` [PULL 07/28] fuse: Fix mount options Kevin Wolf
2026-03-10 16:26 ` [PULL 08/28] fuse: Set direct_io and parallel_direct_writes Kevin Wolf
2026-04-30 13:07   ` Fiona Ebner
2026-05-05  9:03     ` Fiona Ebner
2026-05-05 11:01       ` Fiona Ebner
2026-05-05 13:21         ` Hanna Czenczek
2026-03-10 16:26 ` [PULL 09/28] fuse: Introduce fuse_{at,de}tach_handlers() Kevin Wolf
2026-03-10 16:26 ` [PULL 10/28] fuse: Introduce fuse_{inc,dec}_in_flight() Kevin Wolf
2026-03-10 16:26 ` [PULL 11/28] fuse: Add halted flag Kevin Wolf
2026-03-10 16:26 ` [PULL 12/28] fuse: fuse_{read,write}: Rename length to blk_len Kevin Wolf
2026-03-10 16:26 ` [PULL 13/28] iotests/308: Use conv=notrunc to test growability Kevin Wolf
2026-03-10 16:26 ` [PULL 14/28] fuse: Explicitly handle non-grow post-EOF accesses Kevin Wolf
2026-03-10 16:26 ` [PULL 15/28] block: Move qemu_fcntl_addfl() into osdep.c Kevin Wolf
2026-03-10 16:26 ` [PULL 16/28] fuse: Drop permission changes in fuse_do_truncate Kevin Wolf
2026-03-10 16:26 ` [PULL 17/28] fuse: Manually process requests (without libfuse) Kevin Wolf
2026-05-08 11:55   ` Fiona Ebner
2026-05-08 13:06     ` Hanna Czenczek
2026-05-08 13:13       ` Hanna Czenczek [this message]
2026-05-12 15:14         ` Fiona Ebner
2026-03-10 16:26 ` [PULL 18/28] fuse: Reduce max read size Kevin Wolf
2026-03-10 16:26 ` [PULL 19/28] fuse: Process requests in coroutines Kevin Wolf
2026-03-10 16:26 ` [PULL 20/28] block/export: Add multi-threading interface Kevin Wolf
2026-03-10 16:26 ` [PULL 21/28] iotests/307: Test multi-thread export interface Kevin Wolf
2026-03-10 16:26 ` [PULL 22/28] fuse: Make shared export state atomic Kevin Wolf
2026-03-10 16:26 ` [PULL 23/28] fuse: Implement multi-threading Kevin Wolf
2026-03-10 16:26 ` [PULL 24/28] qapi/block-export: Document FUSE's multi-threading Kevin Wolf
2026-03-10 16:26 ` [PULL 25/28] iotests/308: Add multi-threading sanity test Kevin Wolf
2026-03-10 16:26 ` [PULL 26/28] block/nfs: add support for libnfs v6 Kevin Wolf
2026-03-12  9:41   ` Peter Maydell
2026-03-12 16:12     ` Kevin Wolf
2026-03-12 16:19       ` Peter Maydell
2026-03-12 16:47         ` Kevin Wolf
2026-03-20  9:50           ` Peter Maydell
2026-04-09  9:48             ` Peter Maydell
2026-04-09 13:29               ` Kevin Wolf
2026-03-10 16:26 ` [PULL 27/28] qapi: block: Refactor HTTP(s) common arguments Kevin Wolf
2026-03-10 16:26 ` [PULL 28/28] block/curl: add support for S3 presigned URLs Kevin Wolf
2026-03-11 10:43 ` [PULL 00/28] Block layer patches Peter Maydell

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=d5c3d3da-5102-4bdc-87bc-9733fb0cbf09@redhat.com \
    --to=hreitz@redhat.com \
    --cc=f.ebner@proxmox.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.