stat: handle idmapped mounts
authorChristian Brauner <christian.brauner@ubuntu.com>
Thu, 21 Jan 2021 13:19:30 +0000 (14:19 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Sun, 24 Jan 2021 13:27:17 +0000 (14:27 +0100)
commit0d56a4518d5eaf595a24ab2202e171330bb2ed72
tree8abcffb945ef36eb5bd290271a34a246c1d9379d
parent71bc356f93a1c589fad13f7487258f89c417976e
stat: handle idmapped mounts

The generic_fillattr() helper fills in the basic attributes associated
with an inode. Enable it to handle idmapped mounts. If the inode is
accessed through an idmapped mount map it into the mount's user
namespace before we store the uid and gid. If the initial user namespace
is passed nothing changes so non-idmapped mounts will see identical
behavior as before.

Link: https://lore.kernel.org/r/20210121131959.646623-12-christian.brauner@ubuntu.com
Cc: Christoph Hellwig <hch@lst.de>
Cc: David Howells <dhowells@redhat.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: linux-fsdevel@vger.kernel.org
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: James Morris <jamorris@linux.microsoft.com>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
36 files changed:
fs/9p/vfs_inode.c
fs/9p/vfs_inode_dotl.c
fs/afs/inode.c
fs/btrfs/inode.c
fs/ceph/inode.c
fs/cifs/inode.c
fs/coda/inode.c
fs/ecryptfs/inode.c
fs/erofs/inode.c
fs/exfat/file.c
fs/ext2/inode.c
fs/ext4/inode.c
fs/f2fs/file.c
fs/fat/file.c
fs/fuse/dir.c
fs/gfs2/inode.c
fs/hfsplus/inode.c
fs/kernfs/inode.c
fs/libfs.c
fs/minix/inode.c
fs/nfs/inode.c
fs/nfs/namespace.c
fs/ocfs2/file.c
fs/orangefs/inode.c
fs/proc/base.c
fs/proc/generic.c
fs/proc/proc_net.c
fs/proc/proc_sysctl.c
fs/proc/root.c
fs/stat.c
fs/sysv/itree.c
fs/ubifs/dir.c
fs/udf/symlink.c
fs/vboxsf/utils.c
include/linux/fs.h
mm/shmem.c