fs: port vfs_*() helpers to struct mnt_idmap
authorChristian Brauner <brauner@kernel.org>
Fri, 13 Jan 2023 11:49:10 +0000 (12:49 +0100)
committerChristian Brauner (Microsoft) <brauner@kernel.org>
Wed, 18 Jan 2023 16:51:45 +0000 (17:51 +0100)
commitabf08576afe31506b812c8c1be9714f78613f300
treea36fe1103a05873703ab46aa21f12c858542b108
parent64b4cdf22f3b002af4a7cb9651036b6248390286
fs: port vfs_*() helpers to struct mnt_idmap

Convert to struct mnt_idmap.

Last cycle we merged the necessary infrastructure in
256c8aed2b42 ("fs: introduce dedicated idmap type for mounts").
This is just the conversion to struct mnt_idmap.

Currently we still pass around the plain namespace that was attached to a
mount. This is in general pretty convenient but it makes it easy to
conflate namespaces that are relevant on the filesystem with namespaces
that are relevent on the mount level. Especially for non-vfs developers
without detailed knowledge in this area this can be a potential source for
bugs.

Once the conversion to struct mnt_idmap is done all helpers down to the
really low-level helpers will take a struct mnt_idmap argument instead of
two namespace arguments. This way it becomes impossible to conflate the two
eliminating the possibility of any bugs. All of the vfs and all filesystems
only operate on struct mnt_idmap.

Acked-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Christian Brauner (Microsoft) <brauner@kernel.org>
25 files changed:
drivers/base/devtmpfs.c
fs/attr.c
fs/cachefiles/interface.c
fs/cachefiles/namei.c
fs/coredump.c
fs/ecryptfs/inode.c
fs/init.c
fs/inode.c
fs/ksmbd/smb2pdu.c
fs/ksmbd/smbacl.c
fs/ksmbd/vfs.c
fs/ksmbd/vfs.h
fs/ksmbd/vfs_cache.c
fs/namei.c
fs/nfsd/nfs3proc.c
fs/nfsd/nfs4recover.c
fs/nfsd/vfs.c
fs/open.c
fs/overlayfs/overlayfs.h
fs/overlayfs/ovl_entry.h
fs/utimes.c
include/linux/fs.h
ipc/mqueue.c
net/unix/af_unix.c
tools/testing/selftests/bpf/progs/profiler.inc.h