summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/f2fs.h
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2018-03-09 05:47:33 +0100
committerJaegeuk Kim <jaegeuk@kernel.org>2018-03-17 05:55:43 +0100
commit162b27aec9abe9d555b46e3a8e7ab06e7f603cbb (patch)
tree5972037355919ec4623b9a4c8980790610701493 /fs/f2fs/f2fs.h
parentf2fs: support hot file extension (diff)
downloadlinux-162b27aec9abe9d555b46e3a8e7ab06e7f603cbb.tar.xz
linux-162b27aec9abe9d555b46e3a8e7ab06e7f603cbb.zip
f2fs: avoid selinux denial on CAP_SYS_RESOURCE
This fixes CAP_SYS_RESOURCE denial of selinux when using resgid, since it seems selinux reports it at the first place, but mostly we don't need to check this condition first. Reviewed-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/f2fs.h')
-rw-r--r--fs/f2fs/f2fs.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index f6dc70666ebb..3d12277fbe9e 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -1607,13 +1607,13 @@ static inline bool __allow_reserved_blocks(struct f2fs_sb_info *sbi,
return false;
if (IS_NOQUOTA(inode))
return true;
- if (capable(CAP_SYS_RESOURCE))
- return true;
if (uid_eq(sbi->s_resuid, current_fsuid()))
return true;
if (!gid_eq(sbi->s_resgid, GLOBAL_ROOT_GID) &&
in_group_p(sbi->s_resgid))
return true;
+ if (capable(CAP_SYS_RESOURCE))
+ return true;
return false;
}