fstab-generator: fix spurious quota warning for xfs

Filesystems like xfs, btrfs, gfs2 and ocfs2 handle quotas internally
and do not need external quotacheck/quotaon services. When usrquota or
grpquota mount options are used in fstab for these filesystems,
generator_hook_up_quotacheck() falls through to the !fstype_needs_quota()
branch and emits a misleading warning that quotas are "not supported"
when they actually work fine — the kernel handles them internally.

Add fstype_has_internal_quota() to return early with a debug message,
and adopt a tri-state return convention so the caller skips quotaon
when quotacheck was not needed.

The buggy code path was introduced in #24824 and #24880.

Co-developed-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Vincent Mihalkovic
2026-05-19 13:12:43 +01:00
committed by Luca Boccassi
parent 6695167aea
commit b5d5362069
4 changed files with 23 additions and 4 deletions
+11
View File
@@ -385,6 +385,17 @@ bool fstype_needs_quota(const char *fstype) {
"f2fs");
}
bool fstype_has_internal_quota(const char *fstype) {
/* These filesystems have built-in quota support and do not need
* external quotacheck/quotaon services - see the "nothing needed"
* entries in fstype_needs_quota() above. */
return STR_IN_SET(fstype,
"xfs",
"gfs2",
"ocfs2",
"btrfs");
}
bool fstype_is_api_vfs(const char *fstype) {
assert(fstype);
+1
View File
@@ -61,6 +61,7 @@ static inline int path_is_mount_point(const char *path) {
bool fstype_is_network(const char *fstype);
bool fstype_needs_quota(const char *fstype);
bool fstype_has_internal_quota(const char *fstype);
bool fstype_is_api_vfs(const char *fstype);
bool fstype_is_blockdev_backed(const char *fstype);
bool fstype_is_ro(const char *fsype);