Red Hat Bugzilla – Bug 1457975
[RHEL7.X] df -al or df -ali is timing out when using a huge amount ou direct mappings on autofs
Last modified: 2018-04-10 14:03:36 EDT
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.
Thanks, upstream PR to add "-x autofs" created.
Fixed via sos 3.5 rebase.
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