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 E4E341FF0B7 for ; Fri, 13 Nov 2026 04:25:03 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id EC3542191E; Fri, 13 Nov 2026 04:21:58 +0100 (CET) From: Thomas Lamprecht To: pve-devel@lists.proxmox.com Subject: [PATCH storage 01/17] diskmanage: skip SMART queries for NVMe fabric namespaces Date: Fri, 13 Nov 2026 04:04:29 +0100 Message-ID: <20261113030541.1591528-2-t.lamprecht@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261113030541.1591528-1-t.lamprecht@proxmox.com> References: <20261113030541.1591528-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: 1794539147945 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.235 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: AUPZCRWYRLDM3267X5BDI3AKI7ARRYSC X-Message-ID-Hash: AUPZCRWYRLDM3267X5BDI3AKI7ARRYSC 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 d6340d32..1fec9ec5 100644 --- a/src/PVE/Diskmanage.pm +++ b/src/PVE/Diskmanage.pm @@ -644,7 +644,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 2f22fae8..c32ee09a 100644 --- a/src/test/disklist_test.pm +++ b/src/test/disklist_test.pm @@ -266,6 +266,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 =