f2fs: 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
1e5267cd08 ("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: Jaegeuk Kim <jaegeuk@kernel.org>
Cc: Chao Yu <chao@kernel.org>
Cc: linux-f2fs-devel@lists.sourceforge.net
Signed-off-by: Christian Brauner (Microsoft) <brauner@kernel.org>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
committed by
Jaegeuk Kim
parent
0ef4ca04a3
commit
1e8a9191cc
+1
-1
@@ -219,7 +219,7 @@ static int f2fs_acl_update_mode(struct user_namespace *mnt_userns,
|
|||||||
return error;
|
return error;
|
||||||
if (error == 0)
|
if (error == 0)
|
||||||
*acl = NULL;
|
*acl = NULL;
|
||||||
if (!in_group_p(i_gid_into_mnt(mnt_userns, inode)) &&
|
if (!vfsgid_in_group_p(i_gid_into_vfsgid(mnt_userns, inode)) &&
|
||||||
!capable_wrt_inode_uidgid(mnt_userns, inode, CAP_FSETID))
|
!capable_wrt_inode_uidgid(mnt_userns, inode, CAP_FSETID))
|
||||||
mode &= ~S_ISGID;
|
mode &= ~S_ISGID;
|
||||||
*mode_p = mode;
|
*mode_p = mode;
|
||||||
|
|||||||
+3
-2
@@ -871,9 +871,10 @@ static void __setattr_copy(struct user_namespace *mnt_userns,
|
|||||||
inode->i_ctime = attr->ia_ctime;
|
inode->i_ctime = attr->ia_ctime;
|
||||||
if (ia_valid & ATTR_MODE) {
|
if (ia_valid & ATTR_MODE) {
|
||||||
umode_t mode = attr->ia_mode;
|
umode_t mode = attr->ia_mode;
|
||||||
kgid_t kgid = i_gid_into_mnt(mnt_userns, inode);
|
vfsgid_t vfsgid = i_gid_into_vfsgid(mnt_userns, inode);
|
||||||
|
|
||||||
if (!in_group_p(kgid) && !capable_wrt_inode_uidgid(mnt_userns, inode, CAP_FSETID))
|
if (!vfsgid_in_group_p(vfsgid) &&
|
||||||
|
!capable_wrt_inode_uidgid(mnt_userns, inode, CAP_FSETID))
|
||||||
mode &= ~S_ISGID;
|
mode &= ~S_ISGID;
|
||||||
set_acl_inode(inode, mode);
|
set_acl_inode(inode, mode);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user