]> git.proxmox.com Git - pve-storage.git/commit - PVE/Storage/NFSPlugin.pm
nfs: check connection: support NFSv4-only servers without rpcbind
authorFiona Ebner <f.ebner@proxmox.com>
Mon, 23 Jan 2023 09:14:50 +0000 (10:14 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 24 Jan 2023 16:17:35 +0000 (17:17 +0100)
commitacff89540a8bac623978ca04317a79c5c2194f4d
tree9b46a1df8fc805d1986fe55fb0ee9a1ba2e2b872
parenteaff3616f83b36a8a1ae7f07f8e756f149ec4185
nfs: check connection: support NFSv4-only servers without rpcbind

by simply doing a ping with the expected port as a fallback when the
rpcinfo command fails.

The timeout was chosen to be 2 seconds, because that's what the
existing callers of tcp_ping() in the iSCSI and GlusterFS plugins use.

Alternatively, the existing check could be replaced, but that would
1. Dumb down the check.
2. Risk breakage in some corner case that's yet to be discovered.
3. It would still be necessary to use rpcinfo (or dumb the check down
even further) in case port=0; from 'man 5 nfs' about the NFSv4 'port'
option:
> If the specified port value is 0, then the NFS client uses the NFS
> service port number advertised by the server's rpcbind service.

Reported in the community forum:
https://forum.proxmox.com/threads/118466/post-524449
https://forum.proxmox.com/threads/120774/

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
PVE/Storage/NFSPlugin.pm