Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1218045

Summary: Similar but unrelated NFS exports block proper mounting of "parent" mount point
Product: Red Hat Enterprise Linux 7 Reporter: Ian Kent <ikent>
Component: autofsAssignee: Ian Kent <ikent>
Status: CLOSED ERRATA QA Contact: Yongcheng Yang <yoyang>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.1CC: eguan, fs-qe, ikent, pere
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
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 13:00:56 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1203139    
Bug Blocks:    

Comment 2 XuWang 2015-08-28 11:38:51 UTC
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 11:46:51 UTC
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-29 03:08:33 UTC
(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 13:00:56 UTC
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