From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 5C529EB73 for ; Mon, 12 Dec 2022 13:33:14 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 3D39149A3 for ; Mon, 12 Dec 2022 13:33:14 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Mon, 12 Dec 2022 13:33:13 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 2343244A84 for ; Mon, 12 Dec 2022 13:33:13 +0100 (CET) From: Fiona Ebner To: pve-devel@lists.proxmox.com Date: Mon, 12 Dec 2022 13:33:09 +0100 Message-Id: <20221212123309.109693-1-f.ebner@proxmox.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.027 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% 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 Subject: [pve-devel] [PATCH storage] disk manage: pass full NVMe device path to smartctl 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: , X-List-Received-Date: Mon, 12 Dec 2022 12:33:14 -0000 This essentially reverts commit c9bd3d2 ("fix #1123: modify NVME device path for SMART support"). The man page for smartctl states > Use the forms "/dev/nvme[0-9]" (broadcast namespace) or > "/dev/nvme[0-9]n[1-9]" (specific namespace 1-9) for NVMe devices. so it should be fine to pass the path with the specific namespace to smartctl. But that text was already present in the man page of version 6.5, which is the version the commit c9bd3d2 talks about. It might be that it was necessary to drop the specific namespace for the version backported from Stretch to Jessie (the bug report mentions that that version was used[0]), but it's not quite clear. With current versions, passing in the path with the specific namespace did work as expected[1], even on a device with multiple namespaces set up tested locally. In PBS, the path queried via udev::Device::from_syspath("/sys/block/{name}") is passed to smartctl and that also included the specific namespace on the systems I tested with a short script. So pass the full path to make things a little bit simpler and to avoid potential future issues like bug #2020[2]. [0]: https://bugzilla.proxmox.com/show_bug.cgi?id=1123#c3 [1]: https://forum.proxmox.com/threads/113962/post-493185 [2]: https://bugzilla.proxmox.com/show_bug.cgi?id=2020 Signed-off-by: Fiona Ebner --- PVE/Diskmanage.pm | 2 -- test/disk_tests/nvme_smart/{nvme0_smart => nvme0n1_smart} | 0 2 files changed, 2 deletions(-) rename test/disk_tests/nvme_smart/{nvme0_smart => nvme0n1_smart} (100%) diff --git a/PVE/Diskmanage.pm b/PVE/Diskmanage.pm index f682e59..a311ffd 100644 --- a/PVE/Diskmanage.pm +++ b/PVE/Diskmanage.pm @@ -93,8 +93,6 @@ sub get_smart_data { my $smartdata = {}; my $type; - $disk =~ s/n\d+$// if $disk =~ m!^/dev/nvme\d+n\d+$!; - my $cmd = [$SMARTCTL, '-H']; push @$cmd, '-A', '-f', 'brief' if !$healthonly; push @$cmd, $disk; diff --git a/test/disk_tests/nvme_smart/nvme0_smart b/test/disk_tests/nvme_smart/nvme0n1_smart similarity index 100% rename from test/disk_tests/nvme_smart/nvme0_smart rename to test/disk_tests/nvme_smart/nvme0n1_smart -- 2.30.2