On Mon, 24 Jun 2024 11:49:43 -0400, Josef Bacik wrote: > Currently the only way to iterate over mount entries in mount namespaces that > aren't your own is to trawl through /proc in order to find /proc/$PID/mountinfo > for the mount namespace that you want. This is hugely inefficient, so extend > both statmount() and listmount() to allow specifying a mount namespace id in > order to get to mounts in other mount namespaces. > > There are a few components to this > > [...] Applied to the vfs.mount branch of the vfs/vfs.git tree. Patches in the vfs.mount branch should appear in linux-next soon. Please report any outstanding bugs that were missed during review in a new review to the original patch series allowing us to drop it. It's encouraged to provide Acked-bys and Reviewed-bys even though the patch has now been applied. If possible patch trailers will be updated. Note that commit hashes shown below are subject to change due to rebase, trailer updates or similar. If in doubt, please check the listed branch. tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git branch: vfs.mount [1/8] fs: relax permissions for listmount() https://git.kernel.org/vfs/vfs/c/ebfdd03a9748 [2/8] fs: relax permissions for statmount() https://git.kernel.org/vfs/vfs/c/a2f1759d19d1 [3/8] fs: keep an index of current mount namespaces https://git.kernel.org/vfs/vfs/c/0e79b98f19f8 [4/8] fs: export the mount ns id via statmount https://git.kernel.org/vfs/vfs/c/c64449b0b4ae [5/8] fs: Allow listmount() in foreign mount namespace https://git.kernel.org/vfs/vfs/c/047afedd2e22 [6/8] fs: Allow statmount() in foreign mount namespace https://git.kernel.org/vfs/vfs/c/1661e867c946 [7/8] fs: add an ioctl to get the mnt ns id from nsfs https://git.kernel.org/vfs/vfs/c/00c8d859151b [8/8] selftests: add a test for the foreign mnt ns extensions https://git.kernel.org/vfs/vfs/c/f0f1033dd078