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 1358887 - On Red Hat 7.x systems if you try to access local filesystems using the automounter through /net then the shell and mount could lock up *if* the filesystem your accessing is double exported.
Summary: On Red Hat 7.x systems if you try to access local filesystems using the autom...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: autofs
Version: 7.0
Hardware: x86_64
OS: Linux
high
high
Target Milestone: rc
: ---
Assignee: Ian Kent
QA Contact: Kun Wang
URL:
Whiteboard:
: 1596154 (view as bug list)
Depends On:
Blocks: 1613630
TreeView+ depends on / blocked
 
Reported: 2016-07-21 17:25 UTC by Ashima Rawat
Modified: 2024-01-06 04:25 UTC (History)
10 users (show)

Fixed In Version: autofs-5.0.7-97.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1613630 (view as bug list)
Environment:
Last Closed: 2018-10-30 11:41:29 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Patch - set bind mount as propagation slave (2.12 KB, patch)
2018-07-13 04:34 UTC, Ian Kent
no flags Details | Diff
Patch - add master map pseudo options for mount propagation (6.53 KB, patch)
2018-07-13 04:36 UTC, Ian Kent
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 3508281 0 None None None 2018-06-28 11:11:33 UTC
Red Hat Product Errata RHBA-2018:3283 0 None None None 2018-10-30 11:42:25 UTC

Description Ashima Rawat 2016-07-21 17:25:23 UTC
Description of problem:

On Red Hat 7.x systems if you try to access local filesystems using the automounter through /net then the shell and mount could lock up *if* the filesystem your accessing is double exported.

Version-Release number of selected component (if applicable):

RHEL 7.0


How reproducible:
Export the shares and then try to access local filesystems using the automounter through /net.


Steps to Reproduce:
1. Exported the shares on RHEL 7.2 machine identical as yours.
 
[root@dhcp8-30 ~]# exportfs -rav
exporting *:/tmp
exporting *:/export
exporting *:/

2. Started autofs service and when trying to access /tmp via net maps it hangs indefinitely.

[root@dhcp8-30 ~]# systemctl status autofs.service
● autofs.service - Automounts filesystems on demand
   Loaded: loaded (/usr/lib/systemd/system/autofs.service; disabled; vendor preset: disabled)
   Active: inactive (dead)
[root@dhcp8-30 ~]# systemctl enable autofs.service
Created symlink from /etc/systemd/system/multi-user.target.wants/autofs.service to /usr/lib/systemd/system/autofs.service.
[root@dhcp8-30 ~]# systemctl start autofs.service


3. [root@dhcp8-30 ~]# cd /net/dhcp8-30.gsslab.pnq.redhat.com/tmp

Actual results:

Accessing /tmp via the automounter causes shell to hang indefinitely

Comment 2 Ian Kent 2016-07-22 00:30:50 UTC
(In reply to Ashima Rawat from comment #0)
> Description of problem:
> 
> On Red Hat 7.x systems if you try to access local filesystems using the
> automounter through /net then the shell and mount could lock up *if* the
> filesystem your accessing is double exported.
> 
> Version-Release number of selected component (if applicable):
> 
> RHEL 7.0
> 
> 
> How reproducible:
> Export the shares and then try to access local filesystems using the
> automounter through /net.
> 
> 
> Steps to Reproduce:
> 1. Exported the shares on RHEL 7.2 machine identical as yours.
>  
> [root@dhcp8-30 ~]# exportfs -rav
> exporting *:/tmp
> exporting *:/export
> exporting *:/

What is in /etc/exports?

Comment 3 Ashima Rawat 2016-07-22 02:25:46 UTC

Below is the entry from exportfs file:

# cat /etc/exports
/ *(rw,insecure,async)
/export *(rw,insecure,async)
/tmp *(rw,insecure,async)

Comment 4 Ashima Rawat 2016-07-22 02:33:28 UTC
Also autofs debugging logs during the time of issue:

Jul 22 08:02:17 dhcp8-30 automount[1219]: st_expire: state 1 path /net
Jul 22 08:02:17 dhcp8-30 automount[1219]: expire_proc: exp_proc = 140522986755840 path /net
Jul 22 08:02:17 dhcp8-30 automount[1219]: expire_cleanup: got thid 140522986755840 path /net stat 0
Jul 22 08:02:17 dhcp8-30 automount[1219]: expire_cleanup: sigchld: exp 140522986755840 finished, switching from 2 to 1
Jul 22 08:02:17 dhcp8-30 automount[1219]: st_ready: st_ready(): state = 2 path /net
Jul 22 08:02:18 dhcp8-30 automount[1219]: st_expire: state 1 path /misc
Jul 22 08:02:18 dhcp8-30 automount[1219]: expire_proc: exp_proc = 140522986755840 path /misc
Jul 22 08:02:18 dhcp8-30 automount[1219]: expire_cleanup: got thid 140522986755840 path /misc stat 0
Jul 22 08:02:18 dhcp8-30 automount[1219]: expire_cleanup: sigchld: exp 140522986755840 finished, switching from 2 to 1

Comment 5 Ian Kent 2016-07-22 02:36:27 UTC
(In reply to Ashima Rawat from comment #4)
> Also autofs debugging logs during the time of issue:
> 
> Jul 22 08:02:17 dhcp8-30 automount[1219]: st_expire: state 1 path /net
> Jul 22 08:02:17 dhcp8-30 automount[1219]: expire_proc: exp_proc =
> 140522986755840 path /net
> Jul 22 08:02:17 dhcp8-30 automount[1219]: expire_cleanup: got thid
> 140522986755840 path /net stat 0
> Jul 22 08:02:17 dhcp8-30 automount[1219]: expire_cleanup: sigchld: exp
> 140522986755840 finished, switching from 2 to 1
> Jul 22 08:02:17 dhcp8-30 automount[1219]: st_ready: st_ready(): state = 2
> path /net
> Jul 22 08:02:18 dhcp8-30 automount[1219]: st_expire: state 1 path /misc
> Jul 22 08:02:18 dhcp8-30 automount[1219]: expire_proc: exp_proc =
> 140522986755840 path /misc
> Jul 22 08:02:18 dhcp8-30 automount[1219]: expire_cleanup: got thid
> 140522986755840 path /misc stat 0
> Jul 22 08:02:18 dhcp8-30 automount[1219]: expire_cleanup: sigchld: exp
> 140522986755840 finished, switching from 2 to 1

I doubt that is what is in the log at the time of the mount
attempt. What I see in the log is the mount(8) bind mount command
hang but that is on an xfs file system.

What file system is this?

Comment 6 Ian Kent 2016-07-23 01:36:38 UTC
Which file system is this being seen on?
Clearly I can't try and duplicate this if I don't know that.

Comment 7 Ian Kent 2016-07-23 13:16:42 UTC
(In reply to Ian Kent from comment #6)
> Which file system is this being seen on?
> Clearly I can't try and duplicate this if I don't know that.

Never mind, I don't think this is file system specific and
it definitely isn't related to NFS either.

Comment 10 Ian Kent 2016-08-09 02:15:18 UTC
Here's an update on what I've found so far.

The problem isn't related to NFS.
It isn't related to autofs either.

It is due to the root file system being set propagation shared
at boot by systemd.

First let me explain what autofs does for its multi-mount map
entries.

Consider an auto.master entry:

/multi      /etc/auto.test

and an /etc/auto.test which contains:

test    /        server:/exports \
        /tmp     server:/exports/tmp \
        /lib     server:/exports/lib

where the directories /exports, /exports/tmp and /exports/lib
exist.

This is called a multi-mount entry and the individual mounts
of the sub paths are called offsets.

You can see that the root offset (/) is not an autofs file
system which means the offsets, /tmp and /lib, are no longer
within an autofs file system and won't be able to trigger
a mount.

In order to trigger offset mounts an autofs trigger mount
is mounted at each offset.

Now, if server is the local machine autofs will attempt to
bind mount them instead of NFS mounting them.

Assume that all three paths, /exports, /exports/tmp and
/exports/lib are within the root file system.

Then run "ls /multi/test".

This will result in a bind mount of <root fs device> on
/multi/test and two autofs trigger mounts on /multi/test/lib
and /multi/test/tmp.

Because the file system containing these two offset mounts is
shared (mounts propagate in both directions, to the parent
and slaves) both of these autofs mounts will propagate back
to the root file system as mounts of /exports/lib and
/exports/tmp neither of which are managed by automount(8)
effectively blocking access by the actual trigger mounts
when they are accessed.

Running "mount --make-rprivate /" or "mount --make-rslave /"
and performing the above accesses results in the automount(8)
functioning as expected.

If /exports/lib and /exports/tmp are separate file systems
then the extra mounts are propagated along with another
for each that covers the propagated autofs trigger mount
resulting in the multi-mount working but with extra unwanted
mounts due to the propagation.

So far it does not seem possible to change this behaviour
by having automount(8) use mount options related to mount
propagation.

It may be possible to change automount(8) (I'm thinking
about how I might do that now) to make the situation a
little better behaved but there is no way to avoid these
propagated mounts that I can see.

Ian

Comment 11 Ian Kent 2016-08-09 02:35:16 UTC
(In reply to Ian Kent from comment #10)
> 
> If /exports/lib and /exports/tmp are separate file systems
> then the extra mounts are propagated along with another
> for each that covers the propagated autofs trigger mount
> resulting in the multi-mount working but with extra unwanted
> mounts due to the propagation.

In the above I mean that /exports/lib and /exports/tmp are
separate "local" file systems.

Since the case here relates to the autofs hosts map, which
essentially creates a multi-mount entry from the server
exports list, a work around is to add the "nobind" option
to the master map entry for the hosts map.

For example:

/net      -hosts nobind

which will avoid bind mounting and use NFS for mounting
instead, and will work as expected.

There is no workaround for colon escaped local paths, for
example the multi-mount entry:

test    /        :/exports \
        /tmp     :/exports/tmp \
        /lib     :/exports/lib

will not work properly in the way described in comment #10.

Comment 18 Pierguido Lambri 2018-06-28 10:47:04 UTC
*** Bug 1596154 has been marked as a duplicate of this bug. ***

Comment 36 Ian Kent 2018-07-13 04:34:58 UTC
Created attachment 1458628 [details]
Patch - set bind mount as propagation slave

Comment 37 Ian Kent 2018-07-13 04:36:05 UTC
Created attachment 1458629 [details]
Patch - add master map pseudo options for mount propagation

Comment 48 errata-xmlrpc 2018-10-30 11:41:29 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://access.redhat.com/errata/RHBA-2018:3283

Comment 49 Red Hat Bugzilla 2024-01-06 04:25:09 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 120 days


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