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 C1EC61FF066 for ; Mon, 23 Nov 2026 03:01:12 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 91C85214C9; Mon, 23 Nov 2026 03:00:57 +0100 (CET) From: Thomas Lamprecht To: pve-devel@lists.proxmox.com Subject: [PATCH v4 storage 01/25] diskmanage: skip SMART queries for NVMe fabric namespaces Date: Mon, 23 Nov 2026 02:47:38 +0100 Message-ID: <20261123020041.3728085-2-t.lamprecht@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261123020041.3728085-1-t.lamprecht@proxmox.com> References: <20261123020041.3728085-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: 1795399249350 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.148 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: LWMAGHFCWVPREADGVFHW3L4EKWDHWSLX X-Message-ID-Hash: LWMAGHFCWVPREADGVFHW3L4EKWDHWSLX 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, RDMA or Fibre Channel, the query goes to the target and can stall the listing while a path recovers. Skip it for these transports, also for namespaces connected by hand. 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 77f1a0ec..be3fb8fc 100644 --- a/src/PVE/Diskmanage.pm +++ b/src/PVE/Diskmanage.pm @@ -709,7 +709,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 = ($nvme_transport // '') =~ /^(?:tcp|rdma|fc)$/; + 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..38823f8b 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 fc 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 =