summaryrefslogtreecommitdiff
path: root/fs/fat
diff options
context:
space:
mode:
authorChristian Brauner <brauner@kernel.org>2022-09-09 11:30:19 +0200
committerChristian Brauner (Microsoft) <brauner@kernel.org>2022-09-20 11:09:31 +0200
commit41d27f518b955ef4b75b02cc67392aef0809a78d (patch)
treedaac8404c0ee122ab3ebaea3c3735f8db5f671a6 /fs/fat
parentb90cb1053190353cc30f0fef0ef1f378ccc063c5 (diff)
fat: port to vfs{g,u}id_t and associated helpers
A while ago we introduced a dedicated vfs{g,u}id_t type in commit 1e5267cd0895 ("mnt_idmapping: add vfs{g,u}id_t"). We already switched over a good part of the VFS. Ultimately we will remove all legacy idmapped mount helpers that operate only on k{g,u}id_t in favor of the new type safe helpers that operate on vfs{g,u}id_t. Cc: Seth Forshee (Digital Ocean) <sforshee@kernel.org> Cc: Christoph Hellwig <hch@lst.de> Cc: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> Cc: linux-fsdevel@vger.kernel.org Signed-off-by: Christian Brauner (Microsoft) <brauner@kernel.org> Acked-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Diffstat (limited to 'fs/fat')
-rw-r--r--fs/fat/file.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/fat/file.c b/fs/fat/file.c
index 3e4eb3467cb4..8a6b493b5b5f 100644
--- a/fs/fat/file.c
+++ b/fs/fat/file.c
@@ -461,8 +461,9 @@ static int fat_allow_set_time(struct user_namespace *mnt_userns,
{
umode_t allow_utime = sbi->options.allow_utime;
- if (!uid_eq(current_fsuid(), i_uid_into_mnt(mnt_userns, inode))) {
- if (in_group_p(i_gid_into_mnt(mnt_userns, inode)))
+ if (!vfsuid_eq_kuid(i_uid_into_vfsuid(mnt_userns, inode),
+ current_fsuid())) {
+ if (vfsgid_in_group_p(i_gid_into_vfsgid(mnt_userns, inode)))
allow_utime >>= 3;
if (allow_utime & MAY_WRITE)
return 1;