]> git.baikalelectronics.ru Git - kernel.git/commit
NFSv4: Refactor to use user namespaces for nfs4idmap
authorSargun Dhillon <sargun@sargun.me>
Thu, 12 Nov 2020 10:09:52 +0000 (02:09 -0800)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Wed, 2 Dec 2020 19:05:54 +0000 (14:05 -0500)
commit201b90ac294d93afbeb5393da1146c13b6c0426d
tree8bf2bcf2ef734f5a0d43dda4d4e8c9271b98e00b
parent2b249cdec384589a7dc3a48a0aedc3f83073b905
NFSv4: Refactor to use user namespaces for nfs4idmap

In several patches work has been done to enable NFSv4 to use user
namespaces:
0f7b79fd19ae: NFSv4: Convert the NFS client idmapper to use the container user namespace
219d68a08eb8: NFS: When mounting, don't share filesystems between different user namespaces

Unfortunately, the userspace APIs were only such that the userspace facing
side of the filesystem (superblock s_user_ns) could be set to a non init
user namespace. This furthers the fs_context related refactoring, and
piggybacks on top of that logic, so the superblock user namespace, and the
NFS user namespace are the same.

Users can still use rpc.idmapd if they choose to, but there are complexities
with user namespaces and request-key that have yet to be addresssed.

Eventually, we will need to at least:
  * Come up with an upcall mechanism that can be triggered inside of the container,
    or safely triggered outside, with the requisite context to do the right
    mapping. * Handle whatever refactoring needs to be done in net/sunrpc.

Signed-off-by: Sargun Dhillon <sargun@sargun.me>
Tested-by: Alban Crequy <alban.crequy@gmail.com>
Fixes: 29837a505b6e ("NFS: Additional refactoring for fs_context conversion")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
fs/nfs/nfs4client.c