`df` shows bind mounts instead of real mounts.
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| | coreutils (Ubuntu) |
Low
|
Dave Chiluk | ||
| | Trusty |
Low
|
Dave Chiluk | ||
| | Vivid |
Low
|
Dave Chiluk | ||
| | Wily |
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
| Dave Chiluk (chiluk) wrote : | #1 |
The attachment "lp1432871.
[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issue please contact him.]
| tags: | added: patch |
| Dave Chiluk (chiluk) wrote : | #3 |
Fixed 00list to include patch. I'm used to having quilt do that for me.
| Sebastien Bacher (seb128) wrote : | #4 |
@Dave, do you have a pointer to the upstream discussion/bug report? Unsubscribing sponsors as well, there is no need to have it in the sponsoring queue before upstream reviews it since you said to block on that
| affects: | ubuntu → coreutils (Ubuntu) |
| Changed in coreutils (Ubuntu): | |
| importance: | Undecided → Low |
| Dave Chiluk (chiluk) wrote : | #5 |
So after further review this patch does not make sense upstream, so I never submitted it *(see SRU template).
Subscribing sponsors again to see if we want to Ubuntu Sauce patch this for trusty.
| description: | updated |
| description: | updated |
| Dave Chiluk (chiluk) wrote : | #6 |
Fixed version and added origin information to debdiff.
| Adam Conrad (adconrad) wrote : | #7 |
While I agree that the precise behaviour was probably slightly more intuitive, I don't think coreutils is a place we want to diverge from upstream. While you might argue that people who relied on the precise behaviour in local scripts need to fix their scripts on upgrade to trusty (true), I could readily argue that there's an unknown quantity of generic Linux software that relies on the upstream behaviour, and would break on precise but work on trusty.
In reality, both those groups are probably tiny but, again, diverging from upstream isn't the answer.
What we should do, IMO, is fix this to parse /proc/self/
| Changed in coreutils (Ubuntu): | |
| status: | New → Won't Fix |
| Changed in coreutils (Ubuntu): | |
| milestone: | trusty-updates → none |
| Dave Chiluk (chiluk) wrote : | #8 |
I have a new fix for this that I will attempt to upstream. I will submit it again once it gets accepted upstream.
| Changed in coreutils (Ubuntu): | |
| status: | Won't Fix → Incomplete |
| Dave Chiluk (chiluk) wrote : | #9 |
This same patch applies cleanly to both wily and vivid, but it has wily in the changelog.
| Dave Chiluk (chiluk) wrote : | #10 |
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://
| description: | updated |
| description: | updated |
| description: | updated |
| Changed in coreutils (Ubuntu): | |
| status: | Incomplete → In Progress |
| Michael Terry (mterry) wrote : | #11 |
I've uploaded this patch (plus a bugfix merge from Debian) to wily. Thanks for the patch!
| Changed in coreutils (Ubuntu Vivid): | |
| assignee: | nobody → Dave Chiluk (chiluk) |
| Changed in coreutils (Ubuntu Trusty): | |
| assignee: | nobody → Dave Chiluk (chiluk) |
| Launchpad Janitor (janitor) wrote : | #12 |
This bug was fixed in the package coreutils - 8.23-4ubuntu2
---------------
coreutils (8.23-4ubuntu2) wily; urgency=medium
* debian/
- Update Debian's patch to also comment out the tests that are made
obsolete by the same patch. We no longer have non-root support
for "chroot /". Fixes FTBFS.
-- Michael Terry <email address hidden> Wed, 14 Oct 2015 15:44:28 -0400
| Changed in coreutils (Ubuntu Wily): | |
| status: | In Progress → Fix Released |
| 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 |
| Michael Terry (mterry) wrote : | #13 |
Uploaded the patch in comment #9 to vivid-proposed. Will sub ubuntu-sru to this bug.
| Dave Chiluk (chiluk) wrote : | #14 |
In case anyone is wondering. The patch does not cleanly apply against Trusty, and I'm working on a backport/
| Changed in coreutils (Ubuntu Trusty): | |
| importance: | Undecided → Low |
| Changed in coreutils (Ubuntu Vivid): | |
| importance: | Undecided → Low |
Hello Dave, or anyone else affected,
Accepted coreutils into vivid-proposed. The package will build now and be available at https:/
Please help us by testing this new package. See https:/
If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-
Further information regarding the verification process can be found at https:/
| Changed in coreutils (Ubuntu Vivid): | |
| status: | In Progress → Fix Committed |
| tags: | added: verification-needed |
| Dave Chiluk (chiluk) wrote : | #16 |
Here's the debdiff for trusty. The provenance of the patches are included in the header of the debian/patches. I've tested this patch on machines with the above issue as well as machines with varying configurations of disk mounts, and remote mounts even.
| tags: |
added: verification-done-vivid verification-done-wily removed: verification-needed |
| Michael Terry (mterry) wrote : | #17 |
I reviewed and uploaded the trusty version of the patch. ~ubuntu-sru is already subscribed, so I believe that's it from my side.
| Dave Chiluk (chiluk) wrote : | #18 |
Thanks a ton mterry!
| Launchpad Janitor (janitor) wrote : | #19 |
This bug was fixed in the package coreutils - 8.23-3ubuntu1.1
---------------
coreutils (8.23-3ubuntu1.1) vivid; urgency=medium
* Add support for correctly processing /proc/self/
* Fix df to prioritize mounts of the root of a device over bind mounts.
(LP: #1432871)
-- Dave Chiluk <email address hidden> Wed, 30 Sep 2015 21:06:59 +0000
| Changed in coreutils (Ubuntu Vivid): | |
| status: | Fix Committed → Fix Released |
| Chris J Arges (arges) wrote : Update Released | #20 |
The verification of the Stable Release Update for coreutils has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.
| Dave Chiluk (chiluk) wrote : | #21 |
Subscribing sponsors and sru team, as both are still necessary for Trusty.
| Martin Pitt (pitti) wrote : | #22 |
Package got sponsored already, unsubscribing sponsors.
Hello Dave, or anyone else affected,
Accepted coreutils into trusty-proposed. The package will build now and be available at https:/
Please help us by testing this new package. See https:/
If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-
Further information regarding the verification process can be found at https:/
| Changed in coreutils (Ubuntu Trusty): | |
| status: | In Progress → Fix Committed |
| tags: | added: verification-needed |
| Dave Chiluk (chiluk) wrote : | #24 |
Fix ftbfs on tests/df/
Apparently the buildds are running with a slightly different environment than my local build machine which is causing this test to fail due to smart quotes in the set LANG. Explicitly setting LANG=C appears to resolve this.
| Dave Chiluk (chiluk) wrote : | #25 |
Alright so even though the buildds seem to be getting false failures, I did find a regression in the recent build. I'm going to work through that, and possibly open up a new bug for it, at least for vivid, wily, and xenial.
| Dave Chiluk (chiluk) wrote : | #26 |
So the regression I discovered was actually just behavior change. Due to the change to /proc/self/
Additionally I discovered that the test that is now failing was previously being skipped because df was not able to read mount entries on trusty *(which is now fixed in this bug). I'm still working through traces and building tests packages in a ppa to get more output.
| Dave Chiluk (chiluk) wrote : | #27 |
So after far too many builds with additional debug output, I realized that df itself was functioning exactly like the upstream version of df. However, it turns out the testcase was updated between 8.21 and 8.23. Updating the total-unprocessed testcase resolves the ftbfs.
It should be noted that these df testcases have failed to run prior to this change because df could not read the mount table within a chroot. So it is my determination that updating the total-unapproved testcase is the correct course of action. After fixing this testcase all of the other df testcases also now run, and PASS:.
| Dave Chiluk (chiluk) wrote : | #28 |
Patch
Successful test build here - https:/
| Chris J Arges (arges) wrote : | #29 |
Hello Dave, or anyone else affected,
Accepted coreutils into trusty-proposed. The package will build now and be available at https:/
Please help us by testing this new package. See https:/
If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-
Further information regarding the verification process can be found at https:/
| Dave Chiluk (chiluk) wrote : | #30 |
Verified df has been fixed. yay.
| tags: |
added: verification-done verification-done-trusty removed: verification-needed |
| Launchpad Janitor (janitor) wrote : | #31 |
This bug was fixed in the package coreutils - 8.21-1ubuntu5.3
---------------
coreutils (8.21-1ubuntu5.3) trusty; urgency=medium
* Fix ftbfs on buildd by updating total-unprocessed testcase from
upstream. (LP: #1432871)
-- Dave Chiluk <email address hidden> Thu, 03 Dec 2015 09:48:11 -0600
| Changed in coreutils (Ubuntu Trusty): | |
| status: | Fix Committed → Fix Released |
| Eric Jensen (ericcj) wrote : | #32 |
Perhaps it was reverted? This actually works fine for me on trusty in the older 8.21-1ubuntu5.1 but not the newer 8.21-1ubuntu5.3 or 8.21-1ubuntu5.4 I ran into the problem with it outputting UUID because amazon's aws ec2 cloudwatch script mon-put-
ubuntu@
Desired=
| Status=
|/ Err?=(none)
||/ Name Version Architecture Description
+++-===
ii coreutils 8.21-1ubuntu5.4 amd64 GNU core utilities
ubuntu@
Filesystem 1024-blocks Used Available Capacity Mounted on
/dev/disk/
ubuntu@
ubuntu@
Filesystem 1024-blocks Used Available Capacity Mounted on
/dev/disk/
ubuntu@
ubuntu@
Filesystem 1024-blocks Used Available Capacity Mounted on
/dev/xvda1 103071868 6235628 92542676 7% /
| Eric Jensen (ericcj) wrote : | #33 |
Actually I was wrong, on some boxes with coreutils_
I had the version with the fix, but needed to reboot again to get it to take effect I guess. Rebooting after initramfs-tools - 0.103ubuntu4.3 fixed the issue everywhere for me even on coreutils_


Here is the fix that I will propose to upstream. Please do not do this upload until we have buy in from upstream.