fs: port inode_init_owner() to mnt_idmap
authorChristian Brauner <brauner@kernel.org>
Fri, 13 Jan 2023 11:49:25 +0000 (12:49 +0100)
committerChristian Brauner (Microsoft) <brauner@kernel.org>
Thu, 19 Jan 2023 08:24:28 +0000 (09:24 +0100)
commitf2d40141d5d90b882e2c35b226f9244a63b82b6e
treebc259eb6a002166849f3aabdaa690f285140ce89
parent700b7940526d31117fd20b7ed31156df134fbe7f
fs: port inode_init_owner() to 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>
41 files changed:
arch/powerpc/platforms/cell/spufs/inode.c
fs/9p/vfs_inode.c
fs/bfs/dir.c
fs/btrfs/btrfs_inode.h
fs/btrfs/inode.c
fs/btrfs/ioctl.c
fs/btrfs/tests/btrfs-tests.c
fs/ext2/ialloc.c
fs/ext4/ext4.h
fs/ext4/ialloc.c
fs/ext4/namei.c
fs/f2fs/f2fs.h
fs/f2fs/file.c
fs/f2fs/namei.c
fs/hfsplus/inode.c
fs/hugetlbfs/inode.c
fs/inode.c
fs/jfs/jfs_inode.c
fs/minix/bitmap.c
fs/nilfs2/inode.c
fs/ntfs3/inode.c
fs/ocfs2/dlmfs/dlmfs.c
fs/ocfs2/namei.c
fs/omfs/inode.c
fs/overlayfs/dir.c
fs/ramfs/inode.c
fs/reiserfs/namei.c
fs/sysv/ialloc.c
fs/ubifs/dir.c
fs/udf/ialloc.c
fs/ufs/ialloc.c
fs/xfs/xfs_inode.c
fs/xfs/xfs_inode.h
fs/xfs/xfs_iops.c
fs/xfs/xfs_qm.c
fs/xfs/xfs_symlink.c
fs/xfs/xfs_symlink.h
fs/zonefs/super.c
include/linux/fs.h
kernel/bpf/inode.c
mm/shmem.c