OSDN Git Service

fs: port ->create() to pass mnt_idmap
authorChristian Brauner <brauner@kernel.org>
Fri, 13 Jan 2023 11:49:13 +0000 (12:49 +0100)
committerChristian Brauner (Microsoft) <brauner@kernel.org>
Thu, 19 Jan 2023 08:24:25 +0000 (09:24 +0100)
commit6c960e68aaed335a0040f16654f3c5e5bfcf9249
treec904d5109336fc0d205117643a95166dee54e58a
parentb74d24f7a74ffd2d42ca883d84b7422b8d545901
fs: port ->create() to pass 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>
54 files changed:
Documentation/filesystems/locking.rst
Documentation/filesystems/vfs.rst
fs/9p/vfs_inode.c
fs/9p/vfs_inode_dotl.c
fs/affs/affs.h
fs/affs/namei.c
fs/afs/dir.c
fs/bad_inode.c
fs/bfs/dir.c
fs/btrfs/inode.c
fs/ceph/dir.c
fs/cifs/cifsfs.h
fs/cifs/dir.c
fs/coda/dir.c
fs/ecryptfs/inode.c
fs/efivarfs/inode.c
fs/exfat/namei.c
fs/ext2/namei.c
fs/ext4/namei.c
fs/f2fs/namei.c
fs/fat/namei_msdos.c
fs/fat/namei_vfat.c
fs/fuse/dir.c
fs/gfs2/inode.c
fs/hfs/dir.c
fs/hfsplus/dir.c
fs/hostfs/hostfs_kern.c
fs/hpfs/namei.c
fs/hugetlbfs/inode.c
fs/jffs2/dir.c
fs/jfs/namei.c
fs/minix/namei.c
fs/namei.c
fs/nfs/dir.c
fs/nfs/internal.h
fs/nilfs2/namei.c
fs/ntfs3/namei.c
fs/ocfs2/dlmfs/dlmfs.c
fs/ocfs2/namei.c
fs/omfs/dir.c
fs/orangefs/namei.c
fs/overlayfs/dir.c
fs/ramfs/inode.c
fs/reiserfs/namei.c
fs/reiserfs/xattr.c
fs/sysv/namei.c
fs/ubifs/dir.c
fs/udf/namei.c
fs/ufs/namei.c
fs/vboxsf/dir.c
fs/xfs/xfs_iops.c
include/linux/fs.h
ipc/mqueue.c
mm/shmem.c