Red Hat Bugzilla – Bug 1463004
Server availability probe broke tunneling nfs via localhost
Last modified: 2017-12-05 05:03:29 EST
Description of problem:
The nfs server availability probe to avoid lengthy mount timeouts broke tunneling of nfs mounts through localhost.
This also broke mounts when 'port' is specified, but rpcbind is not running.
Also, the test will get a false positive if the nfs server and rpcbind are running on the localhost, but the tunneled system is not available.
Version-Release number of selected component (if applicable):
autofs-5.0.5-131.el6 and newer
upstream beginning with commit 4914be9
Steps to Reproduce:
several options to reproduce the mount failure
1) run nfs server on localhost
create automount map entry to mount localhost, specifying a 'port=#' option
2) create ssh tunnel to another system
specify 'port=#' option in automount map
(rpcbind not running, or rpcbind running without local nfs server)
false positive can be tested by having rpcbind on the local system, but the ssh tunnel not available.
if map entry gives localhost for an nfs mount and specifies a 'port=#' option, bind mount will not be attempted, but the local system's rpcbind will be probed
If the local system is not running rpcbind, this results in a failed mount:
ls: cannot access /home/user02: No such file or directory
If the local system is running rpcbind, the ping only probes the local system, and not the system through the tunnel.
if a port number is specified for an nfs mount referring to localhost, the rpc probe will take the requested port into consideration.
Right, I see, I'll sort this out.
Thanks for the comprehensive problem description.
I see from the case the customer has had some difficulty getting us
to understand the problem.
Please offer my apologies to them and let them know I do understand
the problem (thanks to your description Frank) and I'll try to resolve
it as soon as I can.
Checking availability in this case does introduce some additional
difficulties which I need to work out how to deal with because we do
need this functionality.
I'm not sure how it happened but mount.nfs(8) changed at some point
which is what lead to the check being introduced so there may have
been problems without the autofs change also.
And regarding the autofs_use_lofs configuration option.
In the comments in the configuration file that is installed, and
above a rather lengthy set of descriptions there is this:
# Otions for the amd parser within autofs.
Apart from the spelling mistake, I understand it's easy to miss
that autofs_use_lofs is an amd format map configuration option
not an autofs (Sun) map format option. It's also listed as an
amd option in autofs.conf(5).
So it doesn't relate to what we're looking at here at all.
(In reply to Ian Kent from comment #3)
> Checking availability in this case does introduce some additional
> difficulties which I need to work out how to deal with because we do
> need this functionality.
It looks like fixing the failure to cater for the port option will
resolve all the observed problems.
Testing will tell for sure.
Created attachment 1289937 [details]
Patch - remove some redundant rpc library code
Created attachment 1289938 [details]
Patch - add port parameter to rpc_ping()
(In reply to Frank Sorenson from comment #0)
> Description of problem:
> The nfs server availability probe to avoid lengthy mount timeouts broke
> tunneling of nfs mounts through localhost.
> This also broke mounts when 'port' is specified, but rpcbind is not running.
Making the autofs NFS ping handle accept a port parameter should
deal with that.
When the port option is used rpcbind isn't consulted and a local
bind mount isn't attempted.
> Also, the test will get a false positive if the nfs server and rpcbind are
> running on the localhost, but the tunneled system is not available.
Using the port option is needed when tunnelling like this.
Given that rpcbind isn't consulted when the port option is used
and a different local port can be mapped to the NFS port on the
remote machine conflicts with what's running on the local machine
are avoided. So the added support of a port number parameter for
the autofs NFS ping should be enough.
A build with the above changes is available at:
This should fix the ssh tunnelling problem, please have the client
test this and report back.
Can I have some logs please?
One thing that probably should be done (and ins't yet) is to
use mount options to reduce the number of things that are being
Created attachment 1291946 [details]
Patch - remove some redundant rpc library code (updated)
Created attachment 1291947 [details]
Patch - add port parameter to rpc_ping() (updated)
Created attachment 1291948 [details]
Patch - dont probe NFSv2 by default
Created attachment 1291949 [details]
Patch - add version parameter to rpc_ping()
A build with updated changes is available at:
This should reduce the time taken during automounting for the ssh
tunnelling problem, please have the client test this and report back.
*** Bug 1476343 has been marked as a duplicate of this bug. ***