`df` shows bind mounts instead of real mounts.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
coreutils (Ubuntu) |
Fix Released
|
Low
|
Dave Chiluk | ||
Trusty |
Fix Released
|
Low
|
Dave Chiluk | ||
Vivid |
Fix Released
|
Low
|
Dave Chiluk | ||
Wily |
Fix Released
|
Low
|
Dave Chiluk |
Bug Description
[Impact]
* df displays bind mounts instead of "real" mounts if the bind mount is mounted to a shorter directory.
* justification - When trusty moved to using /proc/mounts this changed behavior from precise. Additionally it doesn't make sense that a bind mount should show up in df over a real root mount.
* Explanation - These patches change behavior of df to rely on /proc/self/
[Test Case]
* $ mount
<snip>
192.168.1.2:/raid on /raid type nfs
/dev/sdc5 on /data type ext4 (rw)
<snip>
/data/a on /a type none (rw,bind)
/raid/temp on /b type none (rw,bind)
$df
Filesystem 1K-blocks Used Available Use% Mounted on
<snip>
/data/a 449830616 229975284 196982196 54% /a
/raid/temp 7752072192 5581343744 1780023296 76% /b
</snip>
I'd expect to see the real mount prioritized over the bind mount. Like so.
$df
Filesystem 1K-blocks Used Available Use% Mounted on
<snip>
/dev/sdc5 449830616 229975284 196982196 54% /data
192.168.1.2:/raid 7752072192 5581438976 1779929088 76% /raid
<snip>
[Regression Potential]
* Patch is upstreamed.
* df command now relies on /proc/self/
[Other Info]
* The behavior of df, mount and similar number of other commands has changed going forward. Previously these commands all processed /etc/mtab which was maintained by the mount command. Going forward they still process /etc/mtab, but this is simply a symlink to /proc/mounts now which is maintained by the kernel and slightly more accurate. Unlike the mount command, the kernel makes no distinction between bind mounts and normal mounts. This is evident by the fact that you can mount a device, bind mount from that device, and then unmount the original mount. The default behavior of df in this case is to simply pick the mounted directory for a device that is the shortest since it has no other information to go on from /proc/mounts. Moving to using /proc/self/
* In order to solve this issue, I have written patches and got them integrated upstream.
gnulib commit: http://
coreutils commit: http://
have been authored by me.
While attempting to push these patches into Ubuntu, it became apparent that our version of coreutils does not contain the requisite patches to correctly support /proc/self/
Patches required in order to support /proc/self/
Origin: upstream, gnulib - http://
commit: http://
commit: http://
commit: http://
commit: http://
Origin: upstream, coreutils - http://
commit: http://
Original bug.
_______
Depending on mount path length df sometimes prioritizes showing bind mounts over real mounts
for example.
$ mount
<snip>
192.168.1.2:/raid on /raid type nfs (rw,nosuid,
/dev/sdc5 on /data type ext4 (rw)
<snip>
/data/a on /a type none (rw,bind)
/raid/temp on /b type none (rw,bind)
$df
Filesystem 1K-blocks Used Available Use% Mounted on
<snip>
/data/a 449830616 229975284 196982196 54% /a
/raid/temp 7752072192 5581343744 1780023296 76% /b
</snip>
I'd expect to see the real mount prioritized over the bind mount. Like so.
$df
Filesystem 1K-blocks Used Available Use% Mounted on
<snip>
/dev/sdc5 449830616 229975284 196982196 54% /data
192.168.1.2:/raid 7752072192 5581438976 1779929088 76% /raid
<snip>
Related branches
Changed in coreutils (Ubuntu): | |
importance: | Undecided → Low |
description: | updated |
Changed in coreutils (Ubuntu): | |
milestone: | trusty-updates → none |
description: | updated |
description: | updated |
description: | updated |
Changed in coreutils (Ubuntu): | |
status: | Incomplete → In Progress |
Changed in coreutils (Ubuntu Vivid): | |
assignee: | nobody → Dave Chiluk (chiluk) |
Changed in coreutils (Ubuntu Trusty): | |
assignee: | nobody → Dave Chiluk (chiluk) |
Changed in coreutils (Ubuntu Vivid): | |
status: | New → In Progress |
Changed in coreutils (Ubuntu Trusty): | |
status: | New → In Progress |
Changed in coreutils (Ubuntu Wily): | |
status: | Fix Released → Fix Committed |
Changed in coreutils (Ubuntu Wily): | |
status: | Fix Committed → Fix Released |
Changed in coreutils (Ubuntu Trusty): | |
importance: | Undecided → Low |
Changed in coreutils (Ubuntu Vivid): | |
importance: | Undecided → Low |
tags: |
added: verification-done-vivid verification-done-wily removed: verification-needed |
Here is the fix that I will propose to upstream. Please do not do this upload until we have buy in from upstream.