mirror of https://gitee.com/openkylin/linux.git
f2fs: fix out-of-repair __setattr_copy()
__setattr_copy() was copied from setattr_copy() in fs/attr.c, there is two missing patches doesn't cover this inner function, fix it. Commit7fa294c899
("userns: Allow chown and setgid preservation") Commit23adbe12ef
("fs,userns: Change inode_capable to capable_wrt_inode_uidgid") Fixes:fbfa2cc58d
("f2fs: add file operations") Cc: stable@vger.kernel.org Signed-off-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
parent
0953fe864c
commit
2562515f0a
|
@ -851,7 +851,8 @@ static void __setattr_copy(struct inode *inode, const struct iattr *attr)
|
|||
if (ia_valid & ATTR_MODE) {
|
||||
umode_t mode = attr->ia_mode;
|
||||
|
||||
if (!in_group_p(inode->i_gid) && !capable(CAP_FSETID))
|
||||
if (!in_group_p(inode->i_gid) &&
|
||||
!capable_wrt_inode_uidgid(inode, CAP_FSETID))
|
||||
mode &= ~S_ISGID;
|
||||
set_acl_inode(inode, mode);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue