From: Max Kellermann <max.kellermann@ionos.com>
To: xiubli@redhat.com, idryomov@gmail.com, ceph-devel@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Max Kellermann <max.kellermann@ionos.com>
Subject: [PATCH v2] fs/ceph/quota: ignore quota with CAP_SYS_RESOURCE
Date: Wed, 11 Sep 2024 16:24:51 +0200 [thread overview]
Message-ID: <20240911142452.4110190-1-max.kellermann@ionos.com> (raw)
In-Reply-To: <4b6aec51-dc23-4e49-86c5-0496823dfa3c@redhat.com>
CAP_SYS_RESOURCE allows users to "override disk quota limits". Most
filesystems have a CAP_SYS_RESOURCE check in all quota check code
paths, but Ceph currently does not. This patch implements the
feature.
Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
---
v1 -> v2: moved capable check to check_quota_exceeded()
---
fs/ceph/quota.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/fs/ceph/quota.c b/fs/ceph/quota.c
index 06ee397e0c3a..c428dc8e8f23 100644
--- a/fs/ceph/quota.c
+++ b/fs/ceph/quota.c
@@ -334,6 +334,9 @@ static bool check_quota_exceeded(struct inode *inode, enum quota_check_op op,
u64 max, rvalue;
bool exceeded = false;
+ if (capable(CAP_SYS_RESOURCE))
+ return false;
+
if (ceph_snap(inode) != CEPH_NOSNAP)
return false;
--
2.45.2
next parent reply other threads:[~2024-09-11 14:25 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <4b6aec51-dc23-4e49-86c5-0496823dfa3c@redhat.com>
2024-09-11 14:24 ` Max Kellermann [this message]
2024-09-11 15:01 ` [PATCH v2] fs/ceph/quota: ignore quota with CAP_SYS_RESOURCE Patrick Donnelly
2024-09-11 15:23 ` Max Kellermann
2024-09-11 18:03 ` Patrick Donnelly
2024-09-11 19:21 ` Max Kellermann
2024-09-11 20:14 ` Patrick Donnelly
2024-09-12 2:00 ` Xiubo Li
2024-09-12 6:36 ` Max Kellermann
2024-09-11 21:03 ` Ilya Dryomov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240911142452.4110190-1-max.kellermann@ionos.com \
--to=max.kellermann@ionos.com \
--cc=ceph-devel@vger.kernel.org \
--cc=idryomov@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=xiubli@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox