Message ID | 20241125104011.36552-1-cgoettsche@seltendoof.de (mailing list archive) |
---|---|
State | New |
Delegated to: | Paul Moore |
Headers | show |
Series | [01/11] coccinelle: Add script to reorder capable() calls | expand |
diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c index 3dd8d6f27725..a2dddffeaac5 100644 --- a/fs/quota/dquot.c +++ b/fs/quota/dquot.c @@ -1281,9 +1281,9 @@ static int ignore_hardlimit(struct dquot *dquot) { struct mem_dqinfo *info = &sb_dqopt(dquot->dq_sb)->info[dquot->dq_id.type]; - return capable(CAP_SYS_RESOURCE) && - (info->dqi_format->qf_fmt_id != QFMT_VFS_OLD || - !(info->dqi_flags & DQF_ROOT_SQUASH)); + return (info->dqi_format->qf_fmt_id != QFMT_VFS_OLD || + !(info->dqi_flags & DQF_ROOT_SQUASH)) && + capable(CAP_SYS_RESOURCE); } static int dquot_add_inodes(struct dquot *dquot, qsize_t inodes,