On Fri, May 9, 2025 at 6:23 AM Miklos Szeredi <miklos@xxxxxxxxxx> wrote: > > On Fri, 9 May 2025 at 09:36, Amir Goldstein <amir73il@xxxxxxxxx> wrote: > > > This is not the case with displaying conn, because lsof is not designed > > to list fuse conn. > > > > Is there a way for userspace to get from conn to fuse server pid? > > Define "server pid". > > One such definition would be > > "A fuse server is a process that has an open file descriptor > referring to a /dev/fuse instance." > > This definition allows a mapping between tasks and fuse connections to > be established. Note that this is not a 1:1 mapping. Multiple > processes could have the same fuse fd (or a clone) open and one > process could have multiple different connections associated with it. > > This might be sufficient for lsof if it can find out the connection > number from the fd. E.g. adding "fuse_connection: N" to fdinfo would > work, I think. For getting from conn to fuse server pid, what about adding the server pid to fuse's sysfs info? This use case has come up a few times in production where we've encountered a stuck server and have wanted to identify its pid. I have a patch on a branch I need to clean up and send out for this, but it adds a new "info" file to /sys/fs/fuse/connections/*/ where libfuse can write any identifying info to that file like the server pid or name. If the connection gets migrated to another process then libfuse is responsible for modifying that to reflect the correct info. Thanks, Joanne > > Thanks, > Miklos >