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 E181C1FF146 for ; Tue, 07 Jul 2026 09:37:54 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 11E2A21443; Tue, 07 Jul 2026 09:37:54 +0200 (CEST) From: Maximiliano Sandoval To: Fiona Ebner Subject: Re: [PATCH storage v4 2/2] nfs: use rpcinfo as a showmount fallback for nfs3 In-Reply-To: (Fiona Ebner's message of "Tue, 7 Jul 2026 09:07:34 +0200") References: <20260706143638.509139-1-m.sandoval@proxmox.com> <20260706143638.509139-3-m.sandoval@proxmox.com> User-Agent: mu4e 1.12.9; emacs 30.1 Date: Tue, 07 Jul 2026 09:37:49 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1783409863444 X-SPAM-LEVEL: Spam detection results: 0 DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) 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: NUTEG3OKL72BJRZKHTNQM7PLUWPH3VK4 X-Message-ID-Hash: NUTEG3OKL72BJRZKHTNQM7PLUWPH3VK4 X-MailFrom: m.sandoval@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 CC: pve-devel@lists.proxmox.com X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Fiona Ebner writes: > Am 06.07.26 um 4:37 PM schrieb Maximiliano Sandoval: >> The check_connection call must succeed in order for the NFS storage to >> be activated. In a setup in which the NFS server does not list exports >> and which only supports NFSv3 this would result in the storage not being >> usable (not without manually mounting the NFS share and using a >> Directory storage instead). We add a fallback check with rpcinfo for >> this case. >> >> The rpcinfo check was replaced with showmount in f8b0d82f. At the time >> the rationale was that rpcinfo did not have support for ipv6 >> connections, which does not hold anymore. >> >> In order to not break compatibility with setups that already activate >> correctly, we add a rpcinfo check as a fallback for NFSv3-only setups >> only after the showmount command fails. >> >> Signed-off-by: Maximiliano Sandoval >> --- >> src/PVE/Storage/NFSPlugin.pm | 11 +++++++++++ >> 1 file changed, 11 insertions(+) >> >> diff --git a/src/PVE/Storage/NFSPlugin.pm b/src/PVE/Storage/NFSPlugin.pm >> index 56dbd9ec..4fe7695a 100644 >> --- a/src/PVE/Storage/NFSPlugin.pm >> +++ b/src/PVE/Storage/NFSPlugin.pm >> @@ -198,6 +198,11 @@ sub check_connection { >> # no exports are listed >> $cmd = $nfs_get_rpcinfo_command->($server, '4'); >> } else { >> + # FIXME: PVE 10: Consider switching to rpcinfo altogether. >> + # There are some potential pitfalls: >> + # - Some NFSv3 servers might only support UDP (cf. RFC 1813, Section 2.3) >> + # - The two timeouts add up to a potential worst-case scenario of 20 seconds > > This is not a pitfall for to the switch to rpcinfo, but related to your > current implementation with showmount+rpcinfo. It's rather easy to spot, > so not sure it needs a comment in the code. I'd rather have it in the > commit message. Running into timeouts is a very common issue in Enterprise support, I do have a strong preference for keeping it as explicit as possible. >> + # - Some NFSv4-only servers might not have rpcbind as described at commit acff8954 > > This is already addressed by the current implementation. If you want to > add such a comment, it should rather be in the fallback branch for v4. OK! >> $cmd = ['/sbin/showmount', '--no-headers', '--exports', $server]; >> } >> >> @@ -214,6 +219,12 @@ sub check_connection { >> return 0 if $port == 0; >> >> return PVE::Network::tcp_ping($server, $port, 2); >> + } else { >> + $cmd = $nfs_get_rpcinfo_command->($server, '3'); >> + eval { >> + run_command($cmd, timeout => 10, outfunc => sub { }, errfunc => sub { }); >> + }; >> + return 1 if !$@; >> } >> return 0; >> } -- Maximiliano