Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1218045 - Similar but unrelated NFS exports block proper mounting of "parent" mount point
Similar but unrelated NFS exports block proper mounting of "parent" mount point
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: autofs (Show other bugs)
7.1
Unspecified Linux
unspecified Severity unspecified
: rc
: ---
Assigned To: Ian Kent
Yongcheng Yang
:
Depends On: 1203139
Blocks:
  Show dependency treegraph
 
Reported: 2015-05-04 02:10 EDT by Ian Kent
Modified: 2015-11-19 08:00 EST (History)
4 users (show)

See Also:
Fixed In Version: (autofs-5.0.7-50
Doc Type: Bug Fix
Doc Text:
Cause: The function cache_get_offset() which returns offsets to be mounted that are within the current current subtree for the mount-as-you-go functionality was not returning the correct map entries. Consequence: This prevented mounts higher up in the tree from being mounted because nested offset triggers created within these mounts would make them look like they weren't mount points to the autofs kernel module. Fix: The offset selection function was modified to return the correct offsets for the given level of the mount tree. Result: Mount trees are now mounted "as-you-go" in the correct order so that mounts higher up in the tree are no longer prevented from being mounted.
Story Points: ---
Clone Of: 1203139
Environment:
Last Closed: 2015-11-19 08:00:56 EST
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)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:2417 normal SHIPPED_LIVE Moderate: autofs security, bug fix and enhancement update 2015-11-19 06:23:21 EST

  None (edit)
Comment 2 XuWang 2015-08-28 07:38:51 EDT
run /autofs/regression/bz1203139-exports-entry-block-parent-mounting for autofs-5.0.7-53.el7, seems good.

run it for previous version:
:: [  BEGIN   ] :: Running 'do_client_test /server/dir1/dir11'
:: [  BEGIN   ] :: Running 'ls /net/intel-s3e36-01.rhts.eng.nay.redhat.com//server/dir1/dir11'
:: [   PASS   ] :: Command 'ls /net/intel-s3e36-01.rhts.eng.nay.redhat.com//server/dir1/dir11' (Expected 0, got 0)
:: [  BEGIN   ] :: Running 'grep "/server/dir1/dir11 .* nfs.*" /proc/mounts'
intel-s3e36-01.rhts.eng.nay.redhat.com:/server/dir1/dir11 /net/intel-s3e36-01.rhts.eng.nay.redhat.com/server/dir1/dir11 nfs4 rw,nosuid,nodev,relatime,vers=4.0,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=10.73.4.199,local_lock=none,addr=10.66.86.26 0 0
:: [   PASS   ] :: Command 'grep "/server/dir1/dir11 .* nfs.*" /proc/mounts' (Expected 0, got 0)
:: [  BEGIN   ] :: Running 'grep "/server/dir1 .* nfs.*" /proc/mounts'
intel-s3e36-01.rhts.eng.nay.redhat.com:/server/dir1 /net/intel-s3e36-01.rhts.eng.nay.redhat.com/server/dir1 nfs4 rw,nosuid,nodev,relatime,vers=4.0,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=10.73.4.199,local_lock=none,addr=10.66.86.26 0 0
:: [   PASS   ] :: Command 'grep "/server/dir1 .* nfs.*" /proc/mounts' (Expected 0, got 0)
:: [  BEGIN   ] :: Running 'grep "/server .* nfs.*" /proc/mounts'
:: [   FAIL   ] :: Command 'grep "/server .* nfs.*" /proc/mounts' (Expected 0, got 1)
:: [   PASS   ] :: Command 'do_client_test /server/dir1/dir11' (Expected 0, got 0)
:: [  BEGIN   ] :: Running 'do_client_test /server/dir2/dir22'
:: [  BEGIN   ] :: Running 'ls /net/intel-s3e36-01.rhts.eng.nay.redhat.com//server/dir2/dir22'
:: [   PASS   ] :: Command 'ls /net/intel-s3e36-01.rhts.eng.nay.redhat.com//server/dir2/dir22' (Expected 0, got 0)
:: [  BEGIN   ] :: Running 'grep "/server/dir2/dir22 .* nfs.*" /proc/mounts'
intel-s3e36-01.rhts.eng.nay.redhat.com:/server/dir2/dir22 /net/intel-s3e36-01.rhts.eng.nay.redhat.com/server/dir2/dir22 nfs4 rw,nosuid,nodev,relatime,vers=4.0,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=10.73.4.199,local_lock=none,addr=10.66.86.26 0 0
:: [   PASS   ] :: Command 'grep "/server/dir2/dir22 .* nfs.*" /proc/mounts' (Expected 0, got 0)
:: [  BEGIN   ] :: Running 'grep "/server/dir2 .* nfs.*" /proc/mounts'
intel-s3e36-01.rhts.eng.nay.redhat.com:/server/dir2 /net/intel-s3e36-01.rhts.eng.nay.redhat.com/server/dir2 nfs4 rw,nosuid,nodev,relatime,vers=4.0,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=10.73.4.199,local_lock=none,addr=10.66.86.26 0 0
:: [   PASS   ] :: Command 'grep "/server/dir2 .* nfs.*" /proc/mounts' (Expected 0, got 0)
:: [  BEGIN   ] :: Running 'grep "/server .* nfs.*" /proc/mounts'
:: [   FAIL   ] :: Command 'grep "/server .* nfs.*" /proc/mounts' (Expected 0, got 1)
:: [   PASS   ] :: Command 'do_client_test /server/dir2/dir22' (Expected 0, got 0)


run it for autofs-5.0.7-53.el7:

:: [  BEGIN   ] :: Running 'do_client_test /server/dir1/dir11'
:: [  BEGIN   ] :: Running 'ls /net/intel-s3e36-01.rhts.eng.nay.redhat.com//server/dir1/dir11'
:: [   PASS   ] :: Command 'ls /net/intel-s3e36-01.rhts.eng.nay.redhat.com//server/dir1/dir11' (Expected 0, got 0)
:: [  BEGIN   ] :: Running 'grep "/server/dir1/dir11 .* nfs.*" /proc/mounts'
intel-s3e36-01.rhts.eng.nay.redhat.com:/server/dir1/dir11 /net/intel-s3e36-01.rhts.eng.nay.redhat.com/server/dir1/dir11 nfs4 rw,nosuid,nodev,relatime,vers=4.0,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=10.73.4.199,local_lock=none,addr=10.66.86.26 0 0
:: [   PASS   ] :: Command 'grep "/server/dir1/dir11 .* nfs.*" /proc/mounts' (Expected 0, got 0)
:: [  BEGIN   ] :: Running 'grep "/server/dir1 .* nfs.*" /proc/mounts'
intel-s3e36-01.rhts.eng.nay.redhat.com:/server/dir1 /net/intel-s3e36-01.rhts.eng.nay.redhat.com/server/dir1 nfs4 rw,nosuid,nodev,relatime,vers=4.0,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=10.73.4.199,local_lock=none,addr=10.66.86.26 0 0
:: [   PASS   ] :: Command 'grep "/server/dir1 .* nfs.*" /proc/mounts' (Expected 0, got 0)
:: [  BEGIN   ] :: Running 'grep "/server .* nfs.*" /proc/mounts'
intel-s3e36-01.rhts.eng.nay.redhat.com:/server /net/intel-s3e36-01.rhts.eng.nay.redhat.com/server nfs4 rw,nosuid,nodev,relatime,vers=4.0,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=10.73.4.199,local_lock=none,addr=10.66.86.26 0 0
:: [   PASS   ] :: Command 'grep "/server .* nfs.*" /proc/mounts' (Expected 0, got 0)
:: [   PASS   ] :: Command 'do_client_test /server/dir1/dir11' (Expected 0, got 0)
:: [  BEGIN   ] :: Running 'do_client_test /server/dir2/dir22'
:: [  BEGIN   ] :: Running 'ls /net/intel-s3e36-01.rhts.eng.nay.redhat.com//server/dir2/dir22'
:: [   PASS   ] :: Command 'ls /net/intel-s3e36-01.rhts.eng.nay.redhat.com//server/dir2/dir22' (Expected 0, got 0)
:: [  BEGIN   ] :: Running 'grep "/server/dir2/dir22 .* nfs.*" /proc/mounts'
intel-s3e36-01.rhts.eng.nay.redhat.com:/server/dir2/dir22 /net/intel-s3e36-01.rhts.eng.nay.redhat.com/server/dir2/dir22 nfs4 rw,nosuid,nodev,relatime,vers=4.0,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=10.73.4.199,local_lock=none,addr=10.66.86.26 0 0
:: [   PASS   ] :: Command 'grep "/server/dir2/dir22 .* nfs.*" /proc/mounts' (Expected 0, got 0)
:: [  BEGIN   ] :: Running 'grep "/server/dir2 .* nfs.*" /proc/mounts'
intel-s3e36-01.rhts.eng.nay.redhat.com:/server/dir2 /net/intel-s3e36-01.rhts.eng.nay.redhat.com/server/dir2 nfs4 rw,nosuid,nodev,relatime,vers=4.0,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=10.73.4.199,local_lock=none,addr=10.66.86.26 0 0
:: [   PASS   ] :: Command 'grep "/server/dir2 .* nfs.*" /proc/mounts' (Expected 0, got 0)
:: [  BEGIN   ] :: Running 'grep "/server .* nfs.*" /proc/mounts'
intel-s3e36-01.rhts.eng.nay.redhat.com:/server /net/intel-s3e36-01.rhts.eng.nay.redhat.com/server nfs4 rw,nosuid,nodev,relatime,vers=4.0,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=10.73.4.199,local_lock=none,addr=10.66.86.26 0 0
:: [   PASS   ] :: Command 'grep "/server .* nfs.*" /proc/mounts' (Expected 0, got 0)
:: [   PASS   ] :: Command 'do_client_test /server/dir2/dir22' (Expected 0, got 0)

I also run regressions, bugzillas, connectathon, stress test cases for autofs-5.0.7-53, no new issues.

so I will change this bug status to be verified.
Comment 3 XuWang 2015-08-28 07:46:51 EDT
Tiny issues, please NOTICE:

1.the following change seems not right, but no affect for usage:

if (pstart[len] != '/' ||	
    strlen(pstart) != len ||
    ^^^^^^^^^^^^^^^^^^^^ this is the new condition added, but if the multi map is like "/a, /a/b, /a/b/c", and for the first time, the ofset will be /a, and in this function, should ignore /a/b and /a/b/c, but with the "strlen(pstart) != len", we can't ignore, only wait for next calling for "cache_get_offset".
           
    strncmp(offset, pstart, len

2. if the nfs server is local relative to autofs, the the symbol link will be used, and a dead lock will happen:
 /a/b will be mounted autofs, and further accessing to /a/b for c will hung.
But in my idea, this is the supposed way.
Comment 4 Ian Kent 2015-08-28 23:08:33 EDT
(In reply to XuWang from comment #3)
> Tiny issues, please NOTICE:

Thanks for the comments.

This particular bit of code is complicated so it is likely
not quite right.

This function isn't meant to get all offsets on each call,
it's meant to get all offsets up to a nesting point boundary.
This is crux of the "mount as you go" functionality and is
what makes it more complicated than I would like.

I'll check it out as soon as I get time.

All the testing I did worked OK and it appears yours has too
so I don't think this is urgent and I have some other high
priority work at the moment.

> 
> 1.the following change seems not right, but no affect for usage:
> 
> if (pstart[len] != '/' ||	
>     strlen(pstart) != len ||
>     ^^^^^^^^^^^^^^^^^^^^ this is the new condition added, but if the multi
> map is like "/a, /a/b, /a/b/c", and for the first time, the ofset will be
> /a, and in this function, should ignore /a/b and /a/b/c, but with the
> "strlen(pstart) != len", we can't ignore, only wait for next calling for
> "cache_get_offset".
>            
>     strncmp(offset, pstart, len
> 
> 2. if the nfs server is local relative to autofs, the the symbol link will
> be used, and a dead lock will happen:
>  /a/b will be mounted autofs, and further accessing to /a/b for c will hung.
> But in my idea, this is the supposed way.
Comment 6 errata-xmlrpc 2015-11-19 08:00:56 EST
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHSA-2015-2417.html

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