Re: [PATCH 4/8] fuse: signal that a fuse filesystem should exhibit local fs behaviors

Miklos Szeredi
2025-09-19T09:24:21Z

On Thu, 18 Sept 2025 at 18:52, Darrick J. Wong <djwong@kernel.org> wrote:
>
> On Wed, Sep 17, 2025 at 10:18:40AM -0700, Joanne Koong wrote:

> > If I'm understanding it correctly, fc->local_fs is set to true if it's
> > a fuseblk device? Why do we need a new "ctx->local_fs" instead of
> > reusing ctx->is_bdev?
>
> Eventually, enabling iomap will also set local_fs=1, as Miklos and I
> sort of touched on a couple weeks ago:
>
> https://lore.kernel.org/linux-fsdevel/CAJfpegvmXnZc=nC4UGw5Gya2cAr-kR0s=WNecnMhdTM_mGyuUg@mail.gmail.com/

I think it might be worth making this property per-inode. I.e. a
distributed filesystem could allow one inode to be completely "owned"
by one client. This would be similar to NFSv4 delegations and could
be refined to read-only (shared) and read-write (exclusive) ownership.
A local filesystem would have all inodes excusively owned.

This's been long on my todo list and also have some prior experiments,
so it's a good opportunity to start working on it again:)

Thanks,
Miklos

>
> --D
>
> > Thanks,
> > Joanne
> >
> > > err = -ENOMEM;
> > > root = fuse_get_root_inode(sb, ctx->rootmode);
> > > @@ -2029,6 +2030,7 @@ static int fuse_init_fs_context(struct fs_context *fsc)
> > > if (fsc->fs_type == &fuseblk_fs_type) {
> > > ctx->is_bdev = true;
> > > ctx->destroy = true;
> > > + ctx->local_fs = true;
> > > }
> > > #endif
> > >
> > >