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 1457975

Summary: [RHEL7.X] df -al or df -ali is timing out when using a huge amount ou direct mappings on autofs
Product: Red Hat Enterprise Linux 7 Reporter: Marco Benatto <mbenatto>
Component: sosAssignee: Pavel Moravec <pmoravec>
Status: CLOSED ERRATA QA Contact: Ondřej Pták <optak>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.3CC: agk, bmr, cww, gavin, ikent, mhradile, optak, plambri, sbradley
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
URL: https://github.com/sosreport/sos/pull/1093
Whiteboard:
Fixed In Version: sos-3.5-1.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-04-10 18:01:47 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:    
Bug Blocks: 1420851, 1464262    
Attachments:
Description Flags
A program to create a huge autofs direct map none

Description Marco Benatto 2017-06-01 16:22:58 UTC
Created attachment 1284211 [details]
A program to create a huge autofs direct map

Description of problem:

When using autofs large direct maps, df -a df -ali could not complete in time during sosreport.


"[root@client73 ~]# sosreport --batch

sosreport (version 3.3)

This command will collect diagnostic and configuration information from
this Red Hat Enterprise Linux system and installed applications.

An archive containing the collected information will be generated in
/var/tmp/sos.UNlJGo and may be provided to a Red Hat support
representative.

Any information provided to Red Hat will be treated in accordance with
the published support policies at:

  https://access.redhat.com/support/

The generated archive may contain data considered sensitive and its
content should be reviewed by the originating organization before being
passed to any third party.

No changes will be made to system configuration.


 Setting up archive ...
 Setting up plugins ...
 Running plugins. Please wait ...

  Running 1/80: abrt...        
  Running 2/80: acpid...        
  Running 3/80: anaconda...        
  Running 4/80: anacron...        
  Running 5/80: auditd...        
  Running 6/80: autofs...        
  Running 7/80: block...        
  Running 8/80: boot...        
  Running 9/80: cgroups...        
  Running 10/80: chrony...        
  Running 11/80: cron...        
  Running 12/80: dbus...        
  Running 13/80: devicemapper...        
  Running 14/80: devices...        
  Running 15/80: dmraid...        
  Running 16/80: etcd...        
  Running 17/80: filesys...        
[plugin:filesys] command 'df -al' timed out after 300s <-- 
[plugin:filesys] command 'df -ali' timed out after 300s" <--

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

rhel-7.3
sos-3.3-4.el7.noarch
coreutils-8.22-18.el7.x86_64


How reproducible:

Always

Steps to Reproduce:

1. Use the attached program to create a large direct map (~30k entries);
2. Configure autofs do use the mappings;
3. Run:
    sosreport --batch


Actual results:

df -al and df -ali times out and generate an empty output on sosreport


Additional info:

Since on RHEL7.x the /etc/mtab file is a symlink to /proc/self/mounts and as direct maps on autofs creates one entry on kernel's mount table for each mapping  the df -a* command will spend lots of time scanning the table, running stat(2) and on the worst case executing statfs(2) on each direct mount triggering unnecessary mounts.

This is a side effect from mtab reflecting the Kernel's mount table view on RHEL7.x, which lead all application which relies on getmntent(3) to see the -auto entries.

My suggestions for this, on sosreport and as -l is not enough on this case, is exclude autofs entries when running df like on the command bellow:

df -ali -x autofs

which will skip the -auto entries from mtab to being listed.

Comment 16 Pavel Moravec 2017-09-06 13:07:41 UTC
Thanks, upstream PR to add "-x autofs" created.

Comment 19 Pavel Moravec 2017-11-02 15:15:42 UTC
Fixed via sos 3.5 rebase.

Comment 25 errata-xmlrpc 2018-04-10 18:01:47 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/RHEA-2018:0963