Instead of requiring all implementations of vfs_quotactl to unbusy
the mount for Q_QUOTAON and Q_QUOTAOFF, add an "mp_busy" in/out param
to VFS_QUOTACTL(9). The implementation may then indicate to the caller
whether it needed to unbusy the mount.
Details
- Reviewers
kib markj - Group Reviewers
manpages ZFS - Commits
- rG6d3e78ad6c11: VFS_QUOTACTL(9): allow implementation to indicate busy state changes
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
sys/kern/vfs_default.c | ||
---|---|---|
1364 | Instead of doubling down on the existing approach, would it be worthwhile to change the interface to VFS_QUOTACTL() so that it takes a "bool *mp_busy" param that allows the implementation to indicate whether the mount busy state was changed? That's not pretty, but it seems a bit more robust than what we have now. |
sys/kern/vfs_default.c | ||
---|---|---|
1364 | bool **mp_busy perhaps? |
sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c | ||
---|---|---|
110 | I believe that I really need to make these ZFS changes conditional on the new __FreeBSD_version and open a PR against the upstream OpenZFS github, is that correct? |
Fix manpage formatting, remove leftover include, fix incorrect deleted line due to fingerslip
sys/fs/nullfs/null_vfsops.c | ||
---|---|---|
305 | Doesn't mp_busy describe the state of the nullfs mount rather than the target mount? Ditto for unionfs. |
sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c | ||
---|---|---|
110 | Yes, please and thank you. |
sys/fs/nullfs/null_vfsops.c | ||
---|---|---|
305 | May be, the right thing to do for stacked filesystems is to disable quota handling from upper at all. For instance, you cannot change async option from upper, why any other administrative setup of lower should be affected? |
sys/fs/nullfs/null_vfsops.c | ||
---|---|---|
305 | Maybe? From my naive perspective as a VFS newbie, this seems like a difference between something that's an attribute of the mount vs. an attribute of the filesystem. Since the async flag pertains to a specific mount, it makes sense to allow it to be changed only by directly operating on that mount. To me quotas seem more like an attribute of the filesystem. Since stacked filesystems are intended to subsume the attributes of their lower filesystems in order to provide additional functionality, it at least doesn't seem wrong to allow them to pass quota operations to the lower filesystems. In a hypothetical world where quotactl was more generic and less UFS-specific, I could imagine a stacked filesystem wanting to do its own quota management before passing the request to the lower FS. |
sys/fs/nullfs/null_vfsops.c | ||
---|---|---|
305 | I have somewhat different perspective there. I would think that administrative configuration of the lower filesystem should be only done on lower mp. Upper mp should provide a view into lower, but otherwise it generally should be not allowed to configure it. This is why I provided the async option as an example of administratively controlled consistency configuration, and I think that quota controls are same. If anything, quota control on mount should control quotas on upper, which would be then strict union of lower and upper limits. But so far nobody asked for this (quotas are rarely used anyway). |
After talking with kib, I've decided to replace D30152 and D30263 with a simpler approach, which will be done in a separate change.
Accordingly I've made the basic quotactl fixes for unionfs and nullfs in this branch, to keep it self contained and avoid the need to be submitted in lockstep with any other changes (with the possible exception of the upstream OpenZFS change)
It's still worth considering whether quotactl should be supported at all for stacked upper filesystems, but I think any change there can be made later.
sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c | ||
---|---|---|
110 |
sys/fs/nullfs/null_vfsops.c | ||
---|---|---|
315 | I would suggest adding a comment explaining why it's not ok to hold both mount points busy. |