From 10c328ef4db5fa5b3423e708c560d506fe875a10 Mon Sep 17 00:00:00 2001 From: Ilia Ross Date: Thu, 10 Sep 2026 04:14:10 +0200 Subject: [PATCH] Fix ext4 quota detection for LABEL and UUID mounts Fixes https://forum.virtualmin.com/t/failed-to-turn-on-quotas-quotaon-using-on-dev-sda1-home-file-exist/137832 --- CHANGELOG.md | 1 + quota/linux-lib.pl | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 710b8e2a8..362646af1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ * Fix IPsec host key generation with modern Libreswan [#2132](https://github.com/webmin/webmin/issues/2132) * Fix journal since filter showing oldest entries on older systemd [forum.virtualmin.com/t/137876](https://forum.virtualmin.com/t/137876) * Fix disk usage and mounted filesystem handling for mount points and devices with spaces, such as ZFS datasets [#2833](https://github.com/webmin/webmin/issues/2833) +* Fix native ext4 quota detection for filesystems mounted using `LABEL=` or `UUID=` identifiers [forum.virtualmin.com/t/137832](https://forum.virtualmin.com/t/137832) * Fix slave zone files staying empty on Debian and Ubuntu secondaries by creating BIND zone files owned by the `bind` user [forum.virtualmin.com/t/137767](https://forum.virtualmin.com/t/137767) * Fix Nginx Webserver module lock files not being released, causing saves to hang during long-running operations diff --git a/quota/linux-lib.pl b/quota/linux-lib.pl index 93757287c..253897f5c 100755 --- a/quota/linux-lib.pl +++ b/quota/linux-lib.pl @@ -1058,7 +1058,8 @@ $mnt ||= (grep { $_->[0] eq $fs } &mount::list_mounted())[0]; return $hidden_ext_quota_mode_cache{$fs} = 0 if (!$mnt || $mnt->[2] !~ /^ext\d+$/ || !&has_command("tune2fs")); my $dev = $mnt->[3] =~ /(?:^|,)loop=([^,]+)/ ? $1 : $mnt->[1]; -$dev = &resolve_and_simplify($dev); +# Preserve LABEL= and UUID= specifiers, which tune2fs resolves itself. +$dev = &resolve_and_simplify($dev) if ($dev !~ /^(?:LABEL|UUID)=/); &clean_language(); my $out = &backquote_command("tune2fs -l ".quotemeta($dev)." 2>/dev/null"); &reset_environment();