Commit 41d27f51 authored by Christian Brauner's avatar Christian Brauner Committed by Christian Brauner (Microsoft)

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
1e5267cd ("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: default avatarChristian Brauner (Microsoft) <brauner@kernel.org>
Acked-by: default avatarOGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
parent b90cb105
...@@ -461,8 +461,9 @@ static int fat_allow_set_time(struct user_namespace *mnt_userns, ...@@ -461,8 +461,9 @@ static int fat_allow_set_time(struct user_namespace *mnt_userns,
{ {
umode_t allow_utime = sbi->options.allow_utime; umode_t allow_utime = sbi->options.allow_utime;
if (!uid_eq(current_fsuid(), i_uid_into_mnt(mnt_userns, inode))) { if (!vfsuid_eq_kuid(i_uid_into_vfsuid(mnt_userns, inode),
if (in_group_p(i_gid_into_mnt(mnt_userns, inode))) current_fsuid())) {
if (vfsgid_in_group_p(i_gid_into_vfsgid(mnt_userns, inode)))
allow_utime >>= 3; allow_utime >>= 3;
if (allow_utime & MAY_WRITE) if (allow_utime & MAY_WRITE)
return 1; return 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment