Commit 2562515f authored by Chao Yu's avatar Chao Yu Committed by Jaegeuk Kim

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.

Commit 7fa294c8 ("userns: Allow chown and setgid preservation")
Commit 23adbe12 ("fs,userns: Change inode_capable to capable_wrt_inode_uidgid")

Fixes: fbfa2cc5 ("f2fs: add file operations")
Cc: stable@vger.kernel.org
Signed-off-by: default avatarChao Yu <yuchao0@huawei.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent 0953fe86
......@@ -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);
}
......
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