Re: [PATCH] fuse: add max_stack_depth to fuse_init_in

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, May 26, 2025 at 10:51 AM Allison Karlitskaya <lis@xxxxxxxxxx> wrote:
>
> hi,
>
> Sorry for being so late to reply to this: it's been busy.
>
> On Fri, 16 May 2025 at 11:07, Miklos Szeredi <miklos@xxxxxxxxxx> wrote:
> > Okay, let's add it to fuse_init_in as uint8_t.
>
> Is this to help save a few bytes?  I'm not sure it's worth it, for a
> few reasons:
>  - there are 11 reserved fields here, which is still quite a lot of room
>  - even if we reduce this to a single byte, we need to add 3 extra
> bytes of padding, which is a bit awkward.  We also only get to use
> this if we have something else that fits into a u8 or u16, otherwise
> it's wasted
>  - we might imagine some sort of a beautiful future where the kernel
> figures out a way to increase this restriction considerably (ie: >
> 256).  I'm not sure how that would look, but it seems foolish to not
> consider it.
>
> I'm happy to redo the patch if you're sure this is right (since I want
> to update the commit message a bit anyway), but how should I call the
> 3 extra bytes in that case?  unused2?  reserved?
>

Allison,

Sorry for joining so late.

I cannot help feeling that all this is really pointless.

The reality is that I don't imagine the kernel's FILESYSTEM_MAX_STACK_DEPTH
constant to grow any time soon and that for the foreseen future
the only valid values for arg->max_stack_depth are 1 or 2.

I can't remember why we did not use 0.
I must have inherited this from the Android patches or something.
As it is, with or without knowing FILESYSTEM_MAX_STACK_DEPTH
this argument is quite hard to document for userspace.

for this reason I left an explicit documentation for the only two
possible values in libfuse:

        /**
         * When FUSE_CAP_PASSTHROUGH is enabled, this is the maximum allowed
         * stacking depth of the backing files.  In current kernel, the maximum
         * allowed stack depth if FILESYSTEM_MAX_STACK_DEPTH (2), which includes
         * the FUSE passthrough layer, so the maximum stacking depth for backing
         * files is 1.
         *
         * The default is FUSE_BACKING_STACKED_UNDER (0), meaning that the
         * backing files cannot be on a stacked filesystem, but another stacked
         * filesystem can be stacked over this FUSE passthrough filesystem.
         *
         * Set this to FUSE_BACKING_STACKED_OVER (1) if backing files may be on
         * a stacked filesystem, such as overlayfs or another FUSE passthrough.
         * In this configuration, another stacked filesystem cannot be stacked
         * over this FUSE passthrough filesystem.
         */
#define FUSE_BACKING_STACKED_UNDER      (0)
#define FUSE_BACKING_STACKED_OVER       (1)

If the problem is that this is not defined in uapi/fuse.h we can define:

#define FUSE_STACKED_UNDER (1)
#define FUSE_STAKCED_OVER (2)

With the comment from libfuse.
If we ever need to pass values greater than 2 we can introduce a new
init flag for that.

What do you think?
Did I misunderstand the problem that you are trying to solve?

Thanks,
Amir.





[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux