How to get an owning userns for a superblock

Andrei Vagin avagin at gmail.com
Tue May 2 00:05:56 UTC 2017


Hello Everyone,

Now superblock has a reference to userns. Is there a way to discover
an owning userns for a superblock from user-space? In CRIU, we need
this information to dump and restore mount namespaces. For other
users, this information can be useful too to analyze and understand
the running system.

Recently we solved a similar problem for namespaces:
https://lkml.org/lkml/2016/7/6/158

In that case, we added two ioctl-s for nsfs files. Here we have a deal
regular files and I am not sure that adding a new ioctl for them is a
good idea.

Another way to solve a problem is use the kcmp() system call. We will
need to add two commands. One is to compare user namespaces and
another one is to compare a supper block userns with another userns.
The first command is required to create a sorted list of user
namespaces and the second command allows to find a proper userns in
this list.

Maybe someone has a better idea about this?

Thanks,
Andrei


More information about the Containers mailing list