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 1434600 - autofs Doesn't Work on First Access
Summary: autofs Doesn't Work on First Access
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: autofs
Version: 6.8
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: rc
: ---
Assignee: Ian Kent
QA Contact: xiaoli feng
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-03-21 21:41 UTC by Jamie Jackson
Modified: 2017-12-06 12:27 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-12-06 12:27:48 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Jamie Jackson 2017-03-21 21:41:04 UTC
Description of problem:

On the first attempt at accessing an automounted path, the request hangs indefinitely. However, if I try in a different terminal immediately afterwards, it responds as suspected. The same behavior happens after a timeout (first fails, subsequent ones work).

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

Linux automount version 5.0.5-123.el6_8

How reproducible:

So far, always.

Steps to Reproduce:

Start the following with:
automount -f -v

Then, run:
ls -ald /mnt/non-co/client_a/testsftp/*YUMA*

auto.master:
---------------------------
#
# Sample auto.master file
# This is a 'master' automounter map and it has the following format:
# mount-point [map-type[,format]:]map [options]
# For details of the format look at auto.master(5).
#
/misc	/etc/auto.misc
#
# NOTE: mounts done from a hosts map will be mounted with the
#	"nosuid" and "nodev" options unless the "suid" and "dev"
#	options are explicitly given.
#
/net	-hosts
#
# Include central master map if it can be found using
# nsswitch sources.
#
# Note that if there are entries for /net or /misc (as
# above) in the included master map any keys that are the
# same will not be seen as the first read key seen takes
# precedence.
#
+auto.master

/mnt/non-co/client_a /etc/auto.client_a_sshfs uid=492,gid=488,--timeout=30,--ghost,--debug
------------------------

auto.client_a_sshfs:
------------------------
testsftp -fstype=fuse,rw,nodev,noatime,debug :sshfs\#redacteduser@redactedhost\:/export/home/files
------------------------

Actual results:

First access hangs. Subsequent access succeeds.

Expected results:

First access succeeds. Subsequent access succeeds.

Additional info:

Linux HOST.REDACTED 2.6.32-642.13.1.el6.x86_64 #1 SMP Wed Nov 23 16:03:01 EST 2016 x86_64 x86_64 x86_64 GNU/Linux

Similar to https://bugs.centos.org/view.php?id=2448

Comment 2 Ian Kent 2017-03-22 02:27:19 UTC
Can you provide a debug log.
Include from autofs start through duplicating the problem please.

Comment 3 Jamie Jackson 2017-03-22 16:39:42 UTC
* Let the first access hang: https://gist.github.com/jamiejackson/c14edd9d6e333452bc1909698517f27e
* SIGINT the first access and try a second: https://gist.github.com/jamiejackson/8b31aeef0d3f7d07b73c9d9e26aa3a76

Comment 4 Ian Kent 2017-03-22 23:46:01 UTC
(In reply to Jamie Jackson from comment #3)
> * Let the first access hang:
> https://gist.github.com/jamiejackson/c14edd9d6e333452bc1909698517f27e
> * SIGINT the first access and try a second:
> https://gist.github.com/jamiejackson/8b31aeef0d3f7d07b73c9d9e26aa3a76

It looks like the mount(8) call to mount the fuse file system never
returns.

Miklos, can you tell me how fuse mounts like this are expected to
behave please.

Comment 5 Miklos Szeredi 2017-03-23 00:00:19 UTC
Hanging is not the expected behavior.

Can reporter try adding "debug,sshfs_debug,loglevel=debug" mount options to see how far it gets before it hangs?

Comment 6 Ian Kent 2017-03-23 00:28:22 UTC
(In reply to Jamie Jackson from comment #0)
> 
> /mnt/non-co/client_a /etc/auto.client_a_sshfs
> uid=492,gid=488,--timeout=30,--ghost,--debug
> ------------------------
> 
> auto.client_a_sshfs:
> ------------------------
> testsftp -fstype=fuse,rw,nodev,noatime,debug
> :sshfs\#redacteduser@redactedhost\:/export/home/files
> ------------------------

Does the debug option, passed to mount(8), for the fuse mount
also imply a foreground option, causing mount(8) to never actually
return?

Comment 7 Miklos Szeredi 2017-03-23 00:54:59 UTC
> Does the debug option, passed to mount(8), for the fuse mount
> also imply a foreground option, causing mount(8) to never actually
> return?

Exactly.  I was thinking about the same thing just now.  But then how does the second instance succeed?

Comment 8 Ian Kent 2017-03-23 04:23:38 UTC
(In reply to Miklos Szeredi from comment #7)
> > Does the debug option, passed to mount(8), for the fuse mount
> > also imply a foreground option, causing mount(8) to never actually
> > return?
> 
> Exactly.  I was thinking about the same thing just now.  But then how does
> the second instance succeed?

Presumably the mount has succeeded so the initiator waits for
mount(8) to return and other accesses (from other processes)
will just follow the mount, not calling back to autofs.

Comment 9 Ian Kent 2017-03-23 06:37:33 UTC
(In reply to Ian Kent from comment #8)
> (In reply to Miklos Szeredi from comment #7)
> > > Does the debug option, passed to mount(8), for the fuse mount
> > > also imply a foreground option, causing mount(8) to never actually
> > > return?
> > 
> > Exactly.  I was thinking about the same thing just now.  But then how does
> > the second instance succeed?
> 
> Presumably the mount has succeeded so the initiator waits for
> mount(8) to return and other accesses (from other processes)
> will just follow the mount, not calling back to autofs.

Hang on, maybe I'm not correct about that.

The callback is synchronous so if it hasn't returned the
mountpoint should still be marked pending and that should
block path walks ..... I'll need to have a look at that.

Comment 10 Jamie Jackson 2017-03-23 14:49:16 UTC
(In reply to Miklos Szeredi from comment #5)
> Hanging is not the expected behavior.
> 
> Can reporter try adding "debug,sshfs_debug,loglevel=debug" mount options to
> see how far it gets before it hangs?

Extra mount debugging options added:

https://gist.github.com/jamiejackson/3ed0c558021d039699ba01b60d10b727

Comment 11 Miklos Szeredi 2017-03-23 15:42:38 UTC
What about if you remove all debug options?

The debug option might be responsible for the hanging.

Comment 12 Jamie Jackson 2017-03-23 15:58:50 UTC
(In reply to Miklos Szeredi from comment #11)
> What about if you remove all debug options?
> 
> The debug option might be responsible for the hanging.

With debugging mount options removed, the problem seems to go away. I'm going to be testing some more, but I think the problem is solved. Thank you!

Side question: Although I didn't necessarily think I'd found a bug, I didn't know where to go for autofs support. While your replies were quick here (thank you), is there another place (mailing list, IRC, forum, etc.) to ask questions if I need mundane help with this stuff in the future?

Comment 13 Ian Kent 2017-03-23 23:33:48 UTC
(In reply to Jamie Jackson from comment #12)
> (In reply to Miklos Szeredi from comment #11)
> > What about if you remove all debug options?
> > 
> > The debug option might be responsible for the hanging.
> 
> With debugging mount options removed, the problem seems to go away. I'm
> going to be testing some more, but I think the problem is solved. Thank you!

That's good to hear.
I'll still have a look at this (although time is short just now) though
since I think other accesses to the mount should block the same way as
the process that triggered the mount.

> 
> Side question: Although I didn't necessarily think I'd found a bug, I didn't
> know where to go for autofs support. While your replies were quick here
> (thank you), is there another place (mailing list, IRC, forum, etc.) to ask
> questions if I need mundane help with this stuff in the future?

See /usr/share/doc/autofs/README, at the bottom.
Some of it is a bit out of date but the mailing list info is accurate.

The list is not very active these days so don't be surprised if it's
quiet.

Comment 14 Jamie Jackson 2017-03-27 16:29:14 UTC
Note Bug 1436322 (missing mailing list).

Comment 15 Ian Kent 2017-03-28 00:55:36 UTC
(In reply to Jamie Jackson from comment #14)
> Note Bug 1436322 (missing mailing list).

We'll deal with that in Bug 1436322.

Comment 16 Ian Kent 2017-03-28 01:12:05 UTC
(In reply to Jamie Jackson from comment #10)
> (In reply to Miklos Szeredi from comment #5)
> > Hanging is not the expected behavior.
> > 
> > Can reporter try adding "debug,sshfs_debug,loglevel=debug" mount options to
> > see how far it gets before it hangs?
> 
> Extra mount debugging options added:
> 
> https://gist.github.com/jamiejackson/3ed0c558021d039699ba01b60d10b727

I'm not sure that the automount(8) log reflects the actual
order of events wrt. the kernel.

Since a signal has been sent to the blocked process (which
should wake up the waiters and complete the request in the
kernel) the pending flag has probably been cleared allowing
walks into the mount that has been completed. But the user
space daemon mount request thread will still be waiting for
the mount execution to complete.

It might be worth checking if not sending a signal to the
blocked process and seeing if other processes are blocked.

Comment 17 Jan Kurik 2017-12-06 12:27:48 UTC
Red Hat Enterprise Linux 6 is in the Production 3 Phase. During the Production 3 Phase, Critical impact Security Advisories (RHSAs) and selected Urgent Priority Bug Fix Advisories (RHBAs) may be released as they become available.

The official life cycle policy can be reviewed here:

http://redhat.com/rhel/lifecycle

This issue does not meet the inclusion criteria for the Production 3 Phase and will be marked as CLOSED/WONTFIX. If this remains a critical requirement, please contact Red Hat Customer Support to request a re-evaluation of the issue, citing a clear business justification. Note that a strong business justification will be required for re-evaluation. Red Hat Customer Support can be contacted via the Red Hat Customer Portal at the following URL:

https://access.redhat.com/


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