Bug 11806

Summary: df MOUNT_POINT hangs if any file system in /proc/self/mounts is unresponsive
Product: Busybox Reporter: Nathan Weeks <nweeks>
Component: OtherAssignee: unassigned
Status: NEW ---    
Severity: normal CC: busybox-cvs
Priority: P5    
Version: 1.29.x   
Target Milestone: ---   
Hardware: All   
OS: Linux   
Host: Target:
Build:

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.