]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitd84d54e838023e6c50ab958796251a38bfd7327a
tree8abcffb945ef36eb5bd290271a34a246c1d9379d
parent4d0586f657f80c4f8bf968a4495eb4601209f3fd
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