Bug #72355
closedclient: statfs ignores `path` parameter to fill quota information
0%
Description
Client::statfs() ignores the passed in path parameter and uses the mount root to fill in quote free/available space. This causes NFS clients using cmount_path=/ to show full volume size rather than quota size. This should be fixed by finding the appropriate quota root the file is in and using it to infer the free/used blocks. It might also help to have a additional inode based interface for the same.
While we are here, NFS-Ganesha also needs to know "boundaries" are for statfs (ffilz description). Currently, @stx_dev is filled with the snapped, as per Client::fill_statx():
stx->stx_dev = in->snapid;
So, it seems like NFS-Ganesha requires unique "id" in stx_dev field for files under a cephfs subvolume. (needs to be confirmed with @Frank Filz).
Updated by Frank Filz 8 months ago
Yes, we need statfs to take an inode and return subvolume quota for that inode. The path option is less useful to us (but if only path is available, we could make it work, inode would be much easier).
We need stx_dev to be unique per sub-volume (and every inode in the sub-volume needs to have the same stx_dev). This is so Ganesha and clients can identify the sub-volume boundaries.
Updated by Christopher Hoffman 8 months ago
- Status changed from New to In Progress
Updated by Christopher Hoffman 8 months ago
I pushed an initial patch for this effort.
What's missing is:
1. Discuss how to identify if an inode is a subvolume or how to get it's parent subvolume inode. The mds currently tracks this. Does the client? I don't see a clear way.
2. We can not swap out 1:1 of stx_dev/st_dev to contain subvolume inode. It is used in fuse_ll.cc and will break some things if swapped out as usage is through fuse.
For number 2, @Greg Farnum mentioned perhaps a config toggle that does the requested change by @Frank Filz that is only used by NFS/someone who knows what they are doing. Another option is perhaps using f_fsid from statfs. It's currently hard coded to -1.
Updated by Christopher Hoffman 8 months ago
Updates:
1) Spoke with Venky and discussed a reliable way for the client to obtain subvolume inode.
2) During statfs, f_fsid now is populated with subvolume inode.
Updated by Christopher Hoffman 8 months ago
- Status changed from In Progress to Fix Under Review
Updated by Greg Farnum 7 months ago
Christopher Hoffman wrote in #note-6:
2) During statfs, f_fsid now is populated with subvolume inode.
Is there any possibility of this causing issues with something like CSI/Rook or OpenStack Manila that we need to watch out for?
Updated by Upkeep Bot 7 months ago
- Status changed from Fix Under Review to Pending Backport
- Merge Commit set to 7b5fe620593d347c0d025daa20ed68b00ba4af35
- Fixed In set to v20.3.0-2464-g7b5fe62059
- Upkeep Timestamp set to 2025-08-19T14:09:08+00:00
Updated by Upkeep Bot 7 months ago
- Copied to Backport #72644: tentacle: client: statfs ignores `path` parameter to fill quota information added
Updated by Upkeep Bot 7 months ago
- Copied to Backport #72645: squid: client: statfs ignores `path` parameter to fill quota information added
Updated by Upkeep Bot 6 months ago
- Status changed from Pending Backport to Resolved
- Upkeep Timestamp changed from 2025-08-19T14:09:08+00:00 to 2025-09-23T01:37:21+00:00