From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id C64231FF0E3 for ; Wed, 18 Nov 2026 21:43:19 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 2D26B217B3; Wed, 18 Nov 2026 21:43:11 +0100 (CET) From: Thomas Lamprecht To: pve-devel@lists.proxmox.com Subject: [PATCH v2 storage 01/17] diskmanage: skip SMART queries for NVMe fabric namespaces Date: Wed, 18 Nov 2026 21:42:20 +0100 Message-ID: <20261118204302.3100813-2-t.lamprecht@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261118204302.3100813-1-t.lamprecht@proxmox.com> References: <20261118204302.3100813-1-t.lamprecht@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1795034587144 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.163 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: J6B2NOVOVPTSMD6K3LM52XEJYJS6SE3L X-Message-ID-Hash: J6B2NOVOVPTSMD6K3LM52XEJYJS6SE3L X-MailFrom: t.lamprecht@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: The disk list queries the SMART health of every disk. For an NVMe namespace attached over TCP or RDMA, the query goes to the target and can stall the listing while a path recovers. Skip the query for these transports. It depends on the transport of the namespace only, so namespaces connected by hand are covered too. Their health shows as unknown, local NVMe drives are queried as before. Signed-off-by: Thomas Lamprecht --- src/PVE/Diskmanage.pm | 4 +++- src/test/disklist_test.pm | 14 ++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/PVE/Diskmanage.pm b/src/PVE/Diskmanage.pm index 557a8a4a..8fda7afc 100644 --- a/src/PVE/Diskmanage.pm +++ b/src/PVE/Diskmanage.pm @@ -694,7 +694,9 @@ sub get_disks { } my ($health, $wearout) = ('UNKNOWN', 'N/A'); - if (!$nosmart) { + # SMART queries over fabrics can stall while a path recovers. + my $remote_nvme = defined($nvme_transport) && $nvme_transport =~ /^(?:tcp|rdma)$/; + if (!$nosmart && !$remote_nvme) { eval { my $smartdata = get_smart_data($devpath, !is_ssdlike($type)); $health = $smartdata->{health} if $smartdata->{health}; diff --git a/src/test/disklist_test.pm b/src/test/disklist_test.pm index f79c59d3..74ca3b2d 100644 --- a/src/test/disklist_test.pm +++ b/src/test/disklist_test.pm @@ -284,6 +284,20 @@ sub test_disk_list { ok($san_disks->{sda}, 'SAN inventory opts into iSCSI'); } + if ($testcasedir eq 'nvme_smart') { + my $smart_calls; + $diskmanage_module->mock(get_smart_data => sub { $smart_calls++; return {} }); + for my $transport (qw(tcp rdma pcie)) { + $smart_calls = 0; + $diskmanage_module->mock(get_nvme_transport => sub { $transport }); + PVE::Diskmanage::get_disks(); + $testcount++; + is($smart_calls, $transport eq 'pcie' ? 1 : 0, "SMART queries for $transport"); + } + $diskmanage_module->unmock('get_smart_data'); + $diskmanage_module->unmock('get_nvme_transport'); + } + if (-f "disk_tests/$testcasedir/multipathd_status_expected.json") { my $status = PVE::Multipath::path_status_by_wwid(); my $expected_status =