Bug 11806 - df MOUNT_POINT hangs if any file system in /proc/self/mounts is unresponsive
Summary: df MOUNT_POINT hangs if any file system in /proc/self/mounts is unresponsive
Status: NEW
Alias: None
Product: Busybox
Classification: Unclassified
Component: Other (show other bugs)
Version: 1.29.x
Hardware: All Linux
: P5 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-04-25 14:38 UTC by Nathan Weeks
Modified: 2019-04-25 14:38 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nathan Weeks 2019-04-25 14:38:14 UTC
When busybox df is invoked with a file operand that is a mount point, it still appears to (per strace) read and sequentially stat every file systems listed in /proc/mounts (/proc/self/mounts) until it finds an entry with a matching st_dev. stat() (and thus df) can hang if one of the file systems in /proc/self/mounts is, e.g., an unresponsive hard-mounted NFS file system.

df from GNU coreutils 8.22 (and earlier) has an optimization where if a df file operand is a mount point, it will stat only that mount point, avoiding a hang in the scenario where some other file system in /proc/self/mounts is in an unresponsive state that would cause stat() to hang.