aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/fs.h
diff options
context:
space:
mode:
authorChristian Brauner <brauner@kernel.org>2022-06-29 12:25:53 +0200
committerChristian Brauner (Microsoft) <brauner@kernel.org>2022-06-29 12:26:48 +0200
commit9adf24a40978c19f57f44572b292b38938da7686 (patch)
treeb7d7b6a4190a33e52a47fc4b2546a038ed72caf0 /include/linux/fs.h
parentmnt_idmapping: return false when comparing two invalid ids (diff)
downloadwireguard-linux-9adf24a40978c19f57f44572b292b38938da7686.tar.xz
wireguard-linux-9adf24a40978c19f57f44572b292b38938da7686.zip
fs: port HAS_UNMAPPED_ID() to vfs{g,u}id_t
The HAS_UNMAPPED_ID() helper is fully self contained so we can port it to vfs{g,u}id_t without much effort. Cc: Seth Forshee <sforshee@digitalocean.com> Signed-off-by: Christian Brauner (Microsoft) <brauner@kernel.org>
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r--include/linux/fs.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index d6e3347cbf69..ec2e35886779 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -2323,8 +2323,8 @@ static inline bool sb_rdonly(const struct super_block *sb) { return sb->s_flags
static inline bool HAS_UNMAPPED_ID(struct user_namespace *mnt_userns,
struct inode *inode)
{
- return !uid_valid(i_uid_into_mnt(mnt_userns, inode)) ||
- !gid_valid(i_gid_into_mnt(mnt_userns, inode));
+ return !vfsuid_valid(i_uid_into_vfsuid(mnt_userns, inode)) ||
+ !vfsgid_valid(i_gid_into_vfsgid(mnt_userns, inode));
}
static inline int iocb_flags(struct file *file);