From 3f5253df4a85a708aae901c9e8ab0497d2406b6e Mon Sep 17 00:00:00 2001 From: Adam Lewenberg Date: Wed, 1 Oct 2025 18:23:19 -0700 Subject: [PATCH] Fix some bugs with quota units. In the create_volume() function the following command appears: my @command = ('-t', 'logs', $volume, $quota_kbytes, $mountpoint); These arguments are used with the "volcreate" command. However, the volcreate command defaults to megabytes if the quota units are not specified. Thus sending $quota_kbytes without units causes volcreate to set the quota at 1000 times too large a value. The solution is to change '$quota_kbytes' to '"${quota_kbytes}k"'. Furthermore the function that parses the logs converts the quota number from megabytes into kilobytes. This would be OK except the configuration that is passed to the volume create assumes that the value is in megabytes. The solution is to simply remove this section of code. --- volcreate-logs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/volcreate-logs b/volcreate-logs index f2a1ca3..9cf0307 100755 --- a/volcreate-logs +++ b/volcreate-logs @@ -298,7 +298,7 @@ sub create_volume { } # Create the volume. - my @command = ('-t', 'logs', $volume, $quota_kbytes, $mountpoint); + my @command = ('-t', 'logs', $volume, "${quota_kbytes}k", $mountpoint); if ($quiet) { unshift(@command, '-q'); } @@ -393,11 +393,6 @@ sub parse_log { warn "Unknown attribute on line $. ($key)\n"; next; } - if ($key eq 'quota') { - if ($value =~ /^\d+$/xms) { - $value = kbytes("${value}M"); - } - } $log{$key} = $value; } warn "Unterminated log group on line $.\n";