On Mon, 5 May 2025 at 23:02, Allison Karlitskaya <lis@xxxxxxxxxx> wrote: > > hi, > > Here's another "would be nice to have this on the record" sort of > thing that I haven't been able to find any other public statements > about. > > FILESYSTEM_MAX_STACK_DEPTH is defined in a non-public header as 2. As > far as I can tell, there's no way to query the limit out of a running > kernel, and there's no indication if this value might ever be > increased. Hopefully it won't be decreased. > > I'm trying to write a userspace binding layer for supporting > passthrough fds in fuse and it's hard to validate user input for the > stacking depth parameter. libfuse hardcodes some constant values (0, > 1) that the user might choose, but in an adjacent comment makes > references to the "current" kernel, suggesting that it might change at > some point. It's also sort of difficult to determine if a value is > valid by probing: choosing an invalid value simply disables > passthrough fd support, which you won't find out about until you > actually go and try to create a passthrough fd, at which point it > fails with EPERM (but which can also happen for many other reasons). > > So, I guess: > - will 2 ever change? It will never be smaller than 2, that's guaranteed. I think there's a good chance of increasing this in the future if there's use case for it. > - if so, can we add some sort of API to get the current value? Yes. Thanks, Miklos