Skip to content

Commit 2562515

Browse files
chaseyuJaegeuk Kim
authored andcommitted
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 7fa294c ("userns: Allow chown and setgid preservation") Commit 23adbe1 ("fs,userns: Change inode_capable to capable_wrt_inode_uidgid") Fixes: fbfa2cc ("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>
1 parent 0953fe8 commit 2562515

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fs/f2fs/file.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -851,7 +851,8 @@ static void __setattr_copy(struct inode *inode, const struct iattr *attr)
851851
if (ia_valid & ATTR_MODE) {
852852
umode_t mode = attr->ia_mode;
853853

854-
if (!in_group_p(inode->i_gid) && !capable(CAP_FSETID))
854+
if (!in_group_p(inode->i_gid) &&
855+
!capable_wrt_inode_uidgid(inode, CAP_FSETID))
855856
mode &= ~S_ISGID;
856857
set_acl_inode(inode, mode);
857858
}

0 commit comments

Comments
 (0)