From: Maximiliano Sandoval <m.sandoval@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH storage v4 2/2] nfs: use rpcinfo as a showmount fallback for nfs3
Date: Mon, 6 Jul 2026 16:36:22 +0200 [thread overview]
Message-ID: <20260706143638.509139-3-m.sandoval@proxmox.com> (raw)
In-Reply-To: <20260706143638.509139-1-m.sandoval@proxmox.com>
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 <m.sandoval@proxmox.com>
---
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
+ # - Some NFSv4-only servers might not have rpcbind as described at commit acff8954
$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;
}
--
2.47.3
next prev parent reply other threads:[~2026-07-06 14:37 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-06 14:36 [PATCH storage v4 0/2] nfs: use rpcinfo as a showmount fallback for nfs3 Maximiliano Sandoval
2026-07-06 14:36 ` [PATCH storage v4 1/2] nfs: create a helper to get rpcinfo commands Maximiliano Sandoval
2026-07-06 14:36 ` Maximiliano Sandoval [this message]
2026-07-07 7:07 ` [PATCH storage v4 2/2] nfs: use rpcinfo as a showmount fallback for nfs3 Fiona Ebner
2026-07-07 7:37 ` Maximiliano Sandoval
2026-07-07 8:06 ` Fiona Ebner
2026-07-07 8:24 ` superseded: " Maximiliano Sandoval
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260706143638.509139-3-m.sandoval@proxmox.com \
--to=m.sandoval@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.