Blame SOURCES/0068-stat-handle-idmapped-mounts.patch

Kmods SIG 9e3ffb
From 0d56a4518d5eaf595a24ab2202e171330bb2ed72 Mon Sep 17 00:00:00 2001
Kmods SIG 9e3ffb
From: Christian Brauner <christian.brauner@ubuntu.com>
Kmods SIG 9e3ffb
Date: Thu, 21 Jan 2021 14:19:30 +0100
Kmods SIG 9e3ffb
Subject: [Backport 0d56a4518d5e] stat: handle idmapped mounts
Kmods SIG 9e3ffb
Kmods SIG 9e3ffb
The generic_fillattr() helper fills in the basic attributes associated
Kmods SIG 9e3ffb
with an inode. Enable it to handle idmapped mounts. If the inode is
Kmods SIG 9e3ffb
accessed through an idmapped mount map it into the mount's user
Kmods SIG 9e3ffb
namespace before we store the uid and gid. If the initial user namespace
Kmods SIG 9e3ffb
is passed nothing changes so non-idmapped mounts will see identical
Kmods SIG 9e3ffb
behavior as before.
Kmods SIG 9e3ffb
Kmods SIG 9e3ffb
Link: https://lore.kernel.org/r/20210121131959.646623-12-christian.brauner@ubuntu.com
Kmods SIG 9e3ffb
Cc: Christoph Hellwig <hch@lst.de>
Kmods SIG 9e3ffb
Cc: David Howells <dhowells@redhat.com>
Kmods SIG 9e3ffb
Cc: Al Viro <viro@zeniv.linux.org.uk>
Kmods SIG 9e3ffb
Cc: linux-fsdevel@vger.kernel.org
Kmods SIG 9e3ffb
Reviewed-by: Christoph Hellwig <hch@lst.de>
Kmods SIG 9e3ffb
Reviewed-by: James Morris <jamorris@linux.microsoft.com>
Kmods SIG 9e3ffb
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Kmods SIG 9e3ffb
---
Kmods SIG 9e3ffb
 src/file.c | 2 +-
Kmods SIG 9e3ffb
 1 file changed, 1 insertion(+), 1 deletion(-)
Kmods SIG 9e3ffb
Kmods SIG 9e3ffb
diff --git a/src/file.c b/src/file.c
Kmods SIG 9e3ffb
index ace35aa8e64b7f416f26cfa194253d27389dfc7f..e9705b3295d31def9c56d86955da9ef359fd9567 100644
Kmods SIG 9e3ffb
--- a/src/file.c
Kmods SIG 9e3ffb
+++ b/src/file.c
Kmods SIG 9e3ffb
@@ -273,7 +273,7 @@ int exfat_getattr(const struct path *path, struct kstat *stat,
Kmods SIG 9e3ffb
 	struct inode *inode = d_backing_inode(path->dentry);
Kmods SIG 9e3ffb
 	struct exfat_inode_info *ei = EXFAT_I(inode);
Kmods SIG 9e3ffb
 
Kmods SIG 9e3ffb
-	generic_fillattr(inode, stat);
Kmods SIG 9e3ffb
+	generic_fillattr(&init_user_ns, inode, stat);
Kmods SIG 9e3ffb
 	exfat_truncate_atime(&stat->atime);
Kmods SIG 9e3ffb
 	stat->result_mask |= STATX_BTIME;
Kmods SIG 9e3ffb
 	stat->btime.tv_sec = ei->i_crtime.tv_sec;
Kmods SIG 9e3ffb
-- 
Kmods SIG 9e3ffb
2.31.1
Kmods SIG 9e3ffb