Re: [PATCH] fat: port to vfs{g,u}id_t and associated helpers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Christian Brauner <brauner@xxxxxxxxxx> writes:

> 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.

If consistent with other parts in kernel, looks good.

Acked-by: OGAWA Hirofumi <hirofumi@xxxxxxxxxxxxxxxxxx>

Thanks.

> Cc: Seth Forshee (Digital Ocean) <sforshee@xxxxxxxxxx>
> Cc: Christoph Hellwig <hch@xxxxxx>
> Cc: OGAWA Hirofumi <hirofumi@xxxxxxxxxxxxxxxxxx>
> Cc: linux-fsdevel@xxxxxxxxxxxxxxx
> Signed-off-by: Christian Brauner (Microsoft) <brauner@xxxxxxxxxx>
> ---
>  fs/fat/file.c | 5 +++--
>  1 file 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;
>
> base-commit: 7e18e42e4b280c85b76967a9106a13ca61c16179

-- 
OGAWA Hirofumi <hirofumi@xxxxxxxxxxxxxxxxxx>



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux