On Mon, 26 May 2025 at 12:12, Amir Goldstein <amir73il@xxxxxxxxx> wrote: > 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 I think the reason the max was defined as 2 when we implemented this in overlayfs is that there was no use case for more since lower layers can be stacked within overlayfs and that leaves stacking of upper layer, which there was some use case for. With the introduction of fuse passthrough, I can imagine that there will be a push to raise this. Which needs careful review of kernel stack usage, but I suspect that we are not yet close to the limit. > the only valid values for arg->max_stack_depth are 1 or 2. > > I can't remember why we did not use 0. Kernel uses s_stack_depth of zero for no stacking, so that's what went into the interface. But we also added FUSE_PASSTHROUGH init flag, which is redundant, since a stack depth of zero also implies no passthrough. > 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) I'm not fond if hard coding these constants as they only make sense with a max stack depth of 2. Thanks, Miklos