From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id 3297A1FF0B0 for ; Tue, 27 Oct 2026 10:32:02 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id EA82321686; Tue, 27 Oct 2026 10:31:59 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wp.pl; s=s20261001; t=1792785066; bh=FYht2L9iAY/UHonsXuSvf9NblAhaQN3DOw+DPi//MIE=; h=From:Sender:To:Subject; b=Y0WWph/U+otGIIpKH29TmsLriydcLAy43vojo1q9LKEQ7tzqDJQhSDrS4FCbks96Y gptyIdkffZxqSvQbNYNbLLB8JSHkiN93dyh3eSRdFyiDIDxAJoBTuiQdqtPJmKwUJo njv8Pm2Qn4mQE4gJVtFgwSOciK9ZrHF8L96Q3lPjPhf3u7BQr1X05pL2UgPgLWcozx 8P12TT7ww8urrYoe3nNIe9Z6gvYPc52+8zpWeJSgwrL+UzP31pNeKot/uGAe8tsBDv hVWvkZtH3tV3g3bsbVwPk2rTh/2OUMoBzyeTFPyDga69ZprVLyRztrCRMeSRa1QpUP qcky0vnJsPckw== Date: Fri, 23 Oct 2026 21:51:04 +0100 From: piknew Sender: piknew To: pve-devel@lists.proxmox.com Subject: [PATCH] fix #7551: smartctl: negative values are reported for SSD wear level Message-ID: <41511f31-adcf-4b25-9d1d-c5ff3d5f5be2@PKPC.local> X-Mailer: TortoiseGit MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 8bit X-WP-MailID: d9fdcf9c99874a75ffdea8471d8ebe38 X-WP-AV: skaner antywirusowy Poczty Wirtualnej Polski X-WP-SPAM: NO 0000000 [MZNE] X-SPAM-LEVEL: Spam detection results: 0 DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain DMARC_PASS -0.1 DMARC pass policy FREEMAIL_FROM 0.001 Sender email is commonly abused enduser mail provider RCVD_IN_DNSWL_NONE -0.0001 Sender listed at https://www.dnswl.org/, no trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record X-MailFrom: mparka@wp.pl X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation Message-ID-Hash: RHV5KT4TDINLUZ5CMMT2V2RA3HOXYRPC X-Message-ID-Hash: RHV5KT4TDINLUZ5CMMT2V2RA3HOXYRPC X-Mailman-Approved-At: Tue, 27 Oct 2026 10:31:50 +0100 X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Signed-off-by: piknew --- src/PVE/Diskmanage.pm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/PVE/Diskmanage.pm b/src/PVE/Diskmanage.pm index d9ce0d0..2d01803 100644 --- a/src/PVE/Diskmanage.pm +++ b/src/PVE/Diskmanage.pm @@ -451,6 +451,13 @@ sub get_wear_leveling_info { foreach my $attr (@$attributes) { next if $attr->{name} !~ m/$register/; $wearout = $attr->{value}; + # As of https://bugzilla.proxmox.com/show_bug.cgi?id=7551 + # Some SSDs (Crucial MX500 for example) are reporting wearout over 100% + # This is directly reflected in "raw". + # When using "value" (wrapped a 8-bit unsigned integer), it shall be normalized. + # Example: + # 101% -> value=255, 102% -> value=254, 103% -> value=253 + $wearout = $wearout - 256 if($wearout > 100); last; } } -- 2.43.0.windows.1