ceph: kernel client cephfs quota support
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v4 Latest6 patches 4 repliesIn review
- v3 RFC3 patches 5 repliesSuperseded
- v2 RFC4 patches 4 repliesSuperseded
Earlier versions · 1
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v1 RFC | 3 patches | 3 replies | Superseded |
Patches in v4 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/6 | ceph: quota: add initial infrastructure to support cephfs quotasfs/ fs/ fs/ +6 more | +168 | 0 replies | |
| 2/6 | ceph: quota: support for ceph.quota.max_filesfs/ fs/ fs/ +1 more | +95 | 0 replies | |
| 3/6 | ceph: quota: don't allow cross-quota renamesfs/ fs/ fs/ | +75 | 0 replies | |
| 4/6 | ceph: quota: support for ceph.quota.max_bytesfs/ fs/ fs/ +1 more | +44 | 0 replies | |
| 5/6 | ceph: quota: update MDS when max_bytes is approachingfs/ fs/ fs/ | +45 | 0 replies | |
| 6/6 | ceph: quota: add quotas to the in-tree cephfs documentationDocumentation/ | +12 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v4 yet.
Cover letter [PATCH v4 0/6] ceph: kernel client cephfs quota support
A cephfs-specific quota implementation has been available in the user-space fuse client for a while. This quota implementation allows an administrator to restrict the number of bytes and/or the number of files in a filesystem subtree. This quota implementation, however, is supported at the client-level only, which means that cooperation is required between different clients accessing the system.
This obviously assumes that all clients are trusted entities and will respect the quotas, preventing users from exceeding the quota limits. Since the kernel client doesn't support quotas, it has not been possible to use it in a cluster where quotas are a requirement.
This patchset adds kernel client support for cephfs quotas as it is currently implemented in the ceph fuse client. Note however that it relies on some still-to-be-merged changes to the MDS (see below, "Changes since v1" for details).
For further details on CephFS quota, see [1].
[1] http://docs.ceph.com/docs/master/cephfs/quota/
** Changes since v3 **
- Rework after review from Yan, Zheng:
* ceph_handle_quota(): Always increment message sequence number, even if inode isn't in cache
* renamed inode variables ino -> in
* get_quota_realm() now returns a ceph_snap_realm instead of ceph_inode_info
- Updated quota.c copyright and added SPDX identifier
- Added max_bytes quota implementation
- Updated Documentation/filesystems/ceph.txt to include reference to quota; also documented added a few more comments to the code.
** Changes since v2 **
Rework after review from Yan, Zheng:
- Dropped patch 0001 ("ceph: add seqlock for snaprealm hierarchy change detection") and use mdsc->snap_rwsem for walking the snaprealm hierarchy instead of adding a seqlock. This means that patches 0003 and 0004 needed to be reworked.
- Added a NULL check in ceph_handle_quota() after the inode lookup with ceph_find_inode().
** Changes since v1 **
Instead of trying to do a reverse path walk to find the "quota realm" for a given directory, this patchset is now using snaprealms. Thus, for testing it, a modified MDS is required:
https://github.com/ukernel/ceph/tree/wip-cephfs-quota-realm
This modified MDS creates a snaprealm when a quota is set in a directory. This means that a client needs only to walk up the snaprealm hierarchy to find a directory that has quotas instead of doing the full reverse path walking.
Note however that this requires an extra patch that adds a seqlock (1st patch in series) to detect changes in the snaprealm hierarchy.
Luis Henriques (6):
ceph: quota: add initial infrastructure to support cephfs quotas
ceph: quota: support for ceph.quota.max_files
ceph: quota: don't allow cross-quota renames
ceph: quota: support for ceph.quota.max_bytes
ceph: quota: update MDS when max_bytes is approaching
ceph: quota: add quotas to the in-tree cephfs documentation
Documentation/filesystems/ceph.txt | 12 ++ fs/ceph/Makefile | 2 +- fs/ceph/dir.c | 16 +++ fs/ceph/file.c | 21 ++- fs/ceph/inode.c | 10 ++ fs/ceph/mds_client.c | 23 ++++ fs/ceph/mds_client.h | 2 + fs/ceph/quota.c | 276 +++++++++++++++++++++++++++++++++++++ fs/ceph/super.h | 14 ++ fs/ceph/xattr.c | 44 ++++++ include/linux/ceph/ceph_features.h | 3 +- include/linux/ceph/ceph_fs.h | 17 +++ 12 files changed, 437 insertions(+), 3 deletions(-) create mode 100644 fs/ceph/quota.c