From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id D8CF91FF2C6 for ; Tue, 9 Jul 2024 11:09:34 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 1EB891B6E0; Tue, 9 Jul 2024 11:09:56 +0200 (CEST) From: Wolfgang Bumiller To: pve-devel@lists.proxmox.com Date: Tue, 9 Jul 2024 11:09:52 +0200 Message-Id: <20240709090952.147779-1-w.bumiller@proxmox.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.086 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [cgroup.pm] Subject: [pve-devel] [PATCH common] fix #5529: cgroup: correctly handle change_cpu_quota without a quota X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" The function can be called with - neither quota nor period - only a period (quota will be 'max') - both $quota was therefore defaulted to 'max' and the check for whether values were provided should use $period instead of $quota. Also move the defaulting-assignment into the condition for clarity. Signed-off-by: Wolfgang Bumiller --- src/PVE/CGroup.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/PVE/CGroup.pm b/src/PVE/CGroup.pm index e2839cf..4d523e2 100644 --- a/src/PVE/CGroup.pm +++ b/src/PVE/CGroup.pm @@ -469,8 +469,8 @@ sub change_cpu_quota { } elsif ($ver == 2) { # cgroupv2 environment, an undefined (unlimited) quota is defined as "max" # in this interface: - $quota //= 'max'; # unlimited - if (defined($quota)) { + if (defined($period)) { + $quota //= 'max'; # unlimited PVE::ProcFSTools::write_proc_entry("$path/cpu.max", "$quota $period"); } else { # we're allowed to only write the quota: -- 2.39.2 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel