Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1511951 - df -l hangs on autofs automounted stale nfs mounts
Summary: df -l hangs on autofs automounted stale nfs mounts
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: coreutils
Version: 26
Hardware: Unspecified
OS: Linux
high
high
Target Milestone: ---
Assignee: Kamil Dudka
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 1668137 1511947
TreeView+ depends on / blocked
 
Reported: 2017-11-10 13:36 UTC by Stepan Broz
Modified: 2019-01-22 08:56 UTC (History)
11 users (show)

Fixed In Version: coreutils-8.28-2.fc28 coreutils-8.27-17.fc27 coreutils-8.27-7.fc26
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1511947
Environment:
Last Closed: 2017-11-15 17:53:09 UTC


Attachments (Terms of Use)

Description Stepan Broz 2017-11-10 13:36:42 UTC
+++ This bug was initially created as a clone of Bug #1511947 +++

Description of problem:
This bug symptomps are identical to those in BZ#1309247, which provided unsatisfactory fix.

The autofs detection is based on '-hosts' string in /proc/self/mounts, however the name of the map can differ greatly.

For example, my auto.direct map results in the following mounts entries (sample):
/etc/auto.direct on /mnt/test/test012 type autofs (rw,relatime,fd=19,pgrp=7520,timeout=300,minproto=5,maxproto=5,direct,pipe_ino=111441)
/etc/auto.direct on /mnt/test/test037 type autofs (rw,relatime,fd=19,pgrp=7520,timeout=300,minproto=5,maxproto=5,direct,pipe_ino=111441)
/etc/auto.direct on /mnt/test/test006 type autofs (rw,relatime,fd=19,pgrp=7520,timeout=300,minproto=5,maxproto=5,direct,pipe_ino=111441)
/etc/auto.direct on /mnt/test/test054 type autofs (rw,relatime,fd=19,pgrp=7520,timeout=300,minproto=5,maxproto=5,direct,pipe_ino=111441)

Should one of those autofs mounts be mounted, the stat() systemcall on the "type autofs" entry would hang until timeout expires:

sample output of strace -Ttt of "df -l":
13:45:54.668017 stat("/mnt/test/test012", 0x7ffc1ff1c480) = -1 EIO (Input/output error) <180.238070>

Upstream version of coreutils-8.28 fixes the issue by skipping dummy_fs for df -l, which prevents calling stat() on the autofs mount entries.

Upstream commits I have found:
http://git.savannah.gnu.org/gitweb/?p=coreutils.git;a=commit;h=a19ff5d8179a7de38109fc78278229fd96f3941a
http://git.savannah.gnu.org/gitweb/?p=coreutils.git;a=commit;h=7c228bc55ed3fd6d56a6ad135438066de2f54a30
http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=commit;h=2768ceb7994506e2cfba88be3b6bd13ef5440a90

This has an impact on test "tests/df/skip-rootfs.sh", which FAILs because rootfs cannot be seen using "df -t rootfs -a" and additionally, the man page of df needs to be modified as dummy filesystems are not visible anymore.

Version-Release number of selected component (if applicable):
coreutils-8.22-18.el7.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Create an NFS server, test directories and export them (/etc/exports):

    /srv/exports/test001 192.168.122.0/24(ro,root_squash)
    /srv/exports/test002 192.168.122.0/24(ro,root_squash)
    /srv/exports/test003 192.168.122.0/24(ro,root_squash)
    /srv/exports/test004 192.168.122.0/24(ro,root_squash)

2. Create autofs map file "/etc/autofs.direct" with direct maps to nfs shares:

    /mnt/test/test001 -ro,root_squash,soft,intr,rsize=8192,wsize=8192 192.168.122.1:/srv/exports/test001
    /mnt/test/test002 -ro,root_squash,soft,intr,rsize=8192,wsize=8192 192.168.122.1:/srv/exports/test002
    /mnt/test/test003 -ro,root_squash,soft,intr,rsize=8192,wsize=8192 192.168.122.1:/srv/exports/test003
    /mnt/test/test004 -ro,root_squash,soft,intr,rsize=8192,wsize=8192 192.168.122.1:/srv/exports/test004

3. Include the "/etc/autofs.direct" in "/etc/auto.master":

    /- /etc/auto.direct

4. Restart autofs and check for the following entries in /proc/self/mounts:

    /etc/auto.direct on /mnt/test/test001 type autofs (rw,relatime,fd=19,pgrp=7520,timeout=300,minproto=5,maxproto=5,direct,pipe_ino=111441)
    /etc/auto.direct on /mnt/test/test002 type autofs (rw,relatime,fd=19,pgrp=7520,timeout=300,minproto=5,maxproto=5,direct,pipe_ino=111441)
    /etc/auto.direct on /mnt/test/test003 type autofs (rw,relatime,fd=19,pgrp=7520,timeout=300,minproto=5,maxproto=5,direct,pipe_ino=111441)
    /etc/auto.direct on /mnt/test/test004 type autofs (rw,relatime,fd=19,pgrp=7520,timeout=300,minproto=5,maxproto=5,direct,pipe_ino=111441)

5. Mount the autofs mountpoint by e.g. # cd /mnt/test/test004 and verify the fs is mounted (/proc/self/mounts):
    192.168.122.1:/srv/exports/test012 on /mnt/test/test012 type nfs4 (... options trimmed ...)

6. Exit the mountpoint to home directory: # cd
7. Stop the NFS service on the NFS server (# systemctl nfs stop).
8. Perform strace -Tttfvs 4096 df -l
 

Actual results:
The df -l command will hang on the stat() call for /mnt/test/test004.

Expected results:
The df -l command does not perform stat() calls on autofs (or dummy) filesystems.

Additional info:
Latest stable version of upstream is not affected. Latest GA Fedora affected too.

Comment 1 Fedora Update System 2017-11-11 08:49:43 UTC
coreutils-8.27-17.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2017-cf7df9b940

Comment 2 Fedora Update System 2017-11-11 08:49:51 UTC
coreutils-8.27-7.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-f5ff6db124

Comment 3 Fedora Update System 2017-11-11 17:31:22 UTC
coreutils-8.27-7.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-f5ff6db124

Comment 4 Fedora Update System 2017-11-12 02:41:40 UTC
coreutils-8.27-17.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-cf7df9b940

Comment 5 Fedora Update System 2017-11-15 17:53:09 UTC
coreutils-8.27-17.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.

Comment 6 Fedora Update System 2017-11-15 20:18:21 UTC
coreutils-8.27-7.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.


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