Bug 1463004 - Server availability probe broke tunneling nfs via localhost
Server availability probe broke tunneling nfs via localhost
Status: ASSIGNED
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: autofs (Show other bugs)
6.9
Unspecified Unspecified
unspecified Severity medium
: rc
: ---
Assigned To: Ian Kent
Filesystem QE
: Patch, Regression
: 1476343 (view as bug list)
Depends On:
Blocks: 1461138 1507140
  Show dependency treegraph
 
Reported: 2017-06-19 17:36 EDT by Frank Sorenson
Modified: 2017-12-05 05:03 EST (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Patch - remove some redundant rpc library code (2.37 KB, patch)
2017-06-21 02:24 EDT, Ian Kent
no flags Details | Diff
Patch - add port parameter to rpc_ping() (5.13 KB, patch)
2017-06-21 02:25 EDT, Ian Kent
no flags Details | Diff
Patch - remove some redundant rpc library code (updated) (3.63 KB, patch)
2017-06-26 07:32 EDT, Ian Kent
no flags Details | Diff
Patch - add port parameter to rpc_ping() (updated) (4.40 KB, patch)
2017-06-26 07:33 EDT, Ian Kent
no flags Details | Diff
Patch - dont probe NFSv2 by default (1.03 KB, patch)
2017-06-26 07:34 EDT, Ian Kent
no flags Details | Diff
Patch - add version parameter to rpc_ping() (4.58 KB, patch)
2017-06-26 07:35 EDT, Ian Kent
no flags Details | Diff

  None (edit)
Description Frank Sorenson 2017-06-19 17:36:06 EDT
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


How reproducible:
easy

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
    stop rpcbind

 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.


Actual results:

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.


Expected results:

if a port number is specified for an nfs mount referring to localhost, the rpc probe will take the requested port into consideration.
Comment 2 Ian Kent 2017-06-19 22:00:33 EDT
Right, I see, I'll sort this out.

Thanks for the comprehensive problem description.
Ian
Comment 3 Ian Kent 2017-06-19 22:48:20 EDT
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.

Ian
Comment 5 Ian Kent 2017-06-20 00:09:46 EDT
(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.

Ian
Comment 6 Ian Kent 2017-06-21 02:24 EDT
Created attachment 1289937 [details]
Patch - remove some redundant rpc library code
Comment 7 Ian Kent 2017-06-21 02:25 EDT
Created attachment 1289938 [details]
Patch - add port parameter to rpc_ping()
Comment 8 Ian Kent 2017-06-21 03:03:51 EDT
(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.

Ian
Comment 9 Ian Kent 2017-06-21 03:06:13 EDT
A build with the above changes is available at:
http://people.redhat.com/~ikent/autofs-5.0.5-132.bz1463004.1.el6_9/

This should fix the ssh tunnelling problem, please have the client
test this and report back.
Comment 14 Ian Kent 2017-06-22 19:12:05 EDT
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
checked for.
Comment 15 Ian Kent 2017-06-26 07:32 EDT
Created attachment 1291946 [details]
Patch - remove some redundant rpc library code (updated)
Comment 16 Ian Kent 2017-06-26 07:33 EDT
Created attachment 1291947 [details]
Patch - add port parameter to rpc_ping() (updated)
Comment 17 Ian Kent 2017-06-26 07:34 EDT
Created attachment 1291948 [details]
Patch - dont probe NFSv2 by default
Comment 18 Ian Kent 2017-06-26 07:35 EDT
Created attachment 1291949 [details]
Patch - add version parameter to rpc_ping()
Comment 19 Ian Kent 2017-06-26 07:44:37 EDT
A build with updated changes is available at:
http://people.redhat.com/~ikent/autofs-5.0.5-132.bz1463004.2.el6_9/

This should reduce the time taken during automounting for the ssh
tunnelling problem, please have the client test this and report back.
Comment 23 Ian Kent 2017-08-01 20:03:01 EDT
*** Bug 1476343 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.