[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <19017a78-b14a-4998-8ebb-f3ffdbfae5b8@redhat.com>
Date: Thu, 29 Aug 2024 14:37:19 +0200
From: Hanna Czenczek <hreitz@...hat.com>
To: Miklos Szeredi <miklos@...redi.hu>
Cc: linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
linux-doc@...r.kernel.org, virtualization@...ts.linux.dev,
Miklos Szeredi <mszeredi@...hat.com>, German Maglione
<gmaglione@...hat.com>, Stefan Hajnoczi <stefanha@...hat.com>,
Eugenio Pérez <eperezma@...hat.com>,
Jonathan Corbet <corbet@....net>, Vivek Goyal <vgoyal@...hat.com>
Subject: Re: [PATCH 0/2] virtio-fs: Add 'file' mount option
On 29.08.24 10:07, Miklos Szeredi wrote:
> On Tue, 9 Jul 2024 at 13:19, Hanna Czenczek <hreitz@...hat.com> wrote:
>> Hi,
>>
>> We want to be able to mount filesystems that just consist of one regular
>> file via virtio-fs, i.e. no root directory, just a file as the root
>> node.
>>
>> While that is possible via FUSE itself (through the 'rootmode' mount
>> option, which is automatically set by the fusermount help program to
>> match the mount point's inode mode), there is no virtio-fs option yet
>> that would allow changing the rootmode from S_IFDIR to S_IFREG.
>>
>> To do that, this series introduces a new 'file' mount option that does
>> precisely that. Alternatively, we could provide the same 'rootmode'
>> option that FUSE has, but as laid out in patch 1's commit description,
>> that option is a bit cumbersome for virtio-fs (in a way that it is not
>> for FUSE), and its usefulness as a more general option is limited.
> I wonder if this is needed at all for virtiofs, which could easily do
> the FUSE_INIT request synchronously with mount(2) and the server could
> just tell the client the root mode explicitly in the FUSE_INIT reply,
> or could just fetch it with a separate FUSE_GETATTR.
That would be great. I thought it would be necessary to install the
superblock before sending FUSE_INIT, so I thought this wasn’t possible.
I honestly have no idea how to go about it on a technical level,
though. Naïvely, I think we’d need to split off the tail of
fuse_fill_super_common() (everything starting from the
fuse_get_root_inode() call) into a separate function, which in case of
virtio-fs we’d call once we get the FUSE_INIT reply. (For
non-virtio-fs, we could just call it immediately after
fuse_fill_super_common().)
But we can’t return from fuse_fill_super() until that root node is set
up, can we? If so, we‘d need to await that FUSE_INIT reply in that
function. Can we do that?
> Why regular fuse doesn't do this? That's because a single threaded
> server can only be supported if the mount(2) syscall returns before
> any request need processing. Virtiofs doesn't suffer from this at
> all, AFAICS.
>
> Does this make sense?
It does!
Hanna
Powered by blists - more mailing lists