From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 806B61FF13E for ; Fri, 20 Mar 2026 15:00:24 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 9BD3218EC5; Fri, 20 Mar 2026 15:00:38 +0100 (CET) From: Maximiliano Sandoval To: Fiona Ebner Subject: Re: [PATCH storage v2 2/2] nfs: use rpcinfo as a showmounts fallback for nfs3 In-Reply-To: (Fiona Ebner's message of "Fri, 20 Mar 2026 13:54:24 +0100") References: <20260319104241.191910-1-m.sandoval@proxmox.com> <20260319104241.191910-3-m.sandoval@proxmox.com> User-Agent: mu4e 1.12.9; emacs 30.1 Date: Fri, 20 Mar 2026 15:00:32 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1774015189251 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.938 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.408 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.819 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.903 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. 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: EMA4RKAI6MJ3CO5J5S7ZXK2HQDIKLBBY X-Message-ID-Hash: EMA4RKAI6MJ3CO5J5S7ZXK2HQDIKLBBY 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 19.03.26 um 11:42 AM 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 the >> Directory storage instead). We add a fallback check with rpcinfo for >> this case. >> >> The rpcinfo check was replaced with showmounts in f8b0d82fe. At the time >> the rationale was that rpcinfo did not have support for ipv6 >> connections, which is not the case at the moment. >> >> 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 showmounts command fails. >> >> Potential pitfalls: >> - Some NFSv3 servers might only support UDP [RFC 1813] >> - The two timeouts add up to 20 seconds which might be too much >> - Some NFS servers might not have rpcbind as described in acff89540 >> >> [RFC 1813]: https://datatracker.ietf.org/doc/html/rfc1813#section-2.3 >> >> Signed-off-by: Maximiliano Sandoval >> --- >> src/PVE/Storage/NFSPlugin.pm | 8 ++++++++ >> 1 file changed, 8 insertions(+) >> >> diff --git a/src/PVE/Storage/NFSPlugin.pm b/src/PVE/Storage/NFSPlugin.pm >> index 062b3f32..0203c0a1 100644 >> --- a/src/PVE/Storage/NFSPlugin.pm >> +++ b/src/PVE/Storage/NFSPlugin.pm >> @@ -193,10 +193,12 @@ sub check_connection { >> >> my $cmd; >> >> + my $is_v3 = defined($opts) && $opts =~ /vers=3.*/; > > What if the version is not explicitly set? Shouldn't we still do the > fallback then? If yes, we can drop the variable here and just do the > fallback in the else branch (i.e. if !$is_v4) since the showmount > command, for which the fallback is intended, also happens in the > !$is_v4 branch. For the sake of keeping the current state as much as possible I intentionally made the fallback happen only if the storage is explicitly configured with vers=3. Is there a way to check whether the NFS storage only supports version 3? one could use this instead as a check. >> my $is_v4 = defined($opts) && $opts =~ /vers=4.*/; >> if ($is_v4) { >> $cmd = tcp_rpcinfo_cmd($server, '4'); >> } else { >> + # TODO Consider switching to rpcinfo altogether for Proxmox VE 10. > > Usually, these messages use 'PVE 10' as a prefix, e.g. > # TODO PVE 10 - actual todo message Noted. >> $cmd = ['/sbin/showmount', '--no-headers', '--exports', $server]; >> } >> >> @@ -213,6 +215,12 @@ sub check_connection { >> return 0 if $port == 0; >> >> return PVE::Network::tcp_ping($server, $port, 2); >> + } elsif ($is_v3) { >> + $cmd = tcp_rpcinfo_cmd($server, '3'); >> + eval { >> + run_command($cmd, timeout => 10, outfunc => sub { }, errfunc => sub { }); >> + }; >> + return 1 if !$@; >> } >> return 0; >> } -- Maximiliano