RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1042840 - wrong handling of bind-mount with "df"
Summary: wrong handling of bind-mount with "df"
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: coreutils
Version: 7.0
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: rc
: ---
Assignee: Kamil Dudka
QA Contact: Radka Brychtova
URL:
Whiteboard:
: 1261032 1450229 1650045 (view as bug list)
Depends On: 1001092
Blocks: 1400024 1400961 1420851 1472751 1668137
TreeView+ depends on / blocked
 
Reported: 2013-12-13 13:57 UTC by Harald Reindl
Modified: 2022-03-13 13:52 UTC (History)
8 users (show)

Fixed In Version: coreutils-8.22-24.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-08-06 13:06:19 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 4088451 0 Troubleshoot None Mounts missing in df output 2019-04-25 16:27:47 UTC
Red Hat Product Errata RHBA-2019:2217 0 None None None 2019-08-06 13:06:28 UTC

Description Harald Reindl 2013-12-13 13:57:54 UTC
scary that this long outstanding problem with df starting from 
Fedora 15 also made it in RHEL7-Beta

https://bugzilla.redhat.com/show_bug.cgi?id=1001092#c12

df = disk free != random mount-point

Comment 2 Ondrej Vasik 2013-12-18 19:37:33 UTC
Because noone so far came with some solution suitable for all situations... /etc/mtab is what df uses and as it is symlink to /proc/mounts , this is the only information df has. There were several approaches to this problem, none of them is perfect.

Comment 3 Harald Reindl 2013-12-18 20:10:10 UTC
it was not a symlink for about 15 years
so maybe such changes should be introduced if they are ready

even in PHP i could write within 10 minutes a script parsing the outputs starting in https://bugzilla.redhat.com/show_bug.cgi?id=1001092#c11 but sadly "coreutils" are not written in PHP so i can't fix them

Comment 4 Ondrej Vasik 2013-12-18 21:56:02 UTC
I haven't introduced the mtab symlink - you know who did... but it was done, so not much to do now.
Coreutils are written to be portable ... this is the main reason why we can't do hacks for Fedora only. Some ugly hack can be written in several minutes, but it will work only on all machines (setups may differ)... and most importantly - most probably will not be acceptable by upstream.
When we had duplicates, people complained, for shortest one device name people complain, first come first serve - people complain - I really don't see any magic solution working for everyone.
The only way would be to write new, linux specific part in gnulib mountlist module, probably inspired by util-linux submounts solution - this way can be identified the main mount. No way how to get the information from /proc/mounts file. As util-linux differ from coreutils style a bit, it could be quite difficult task.

Comment 5 Harald Reindl 2013-12-18 22:08:05 UTC
> When we had duplicates, people complained

because it is unacceptable on a server with some hundret bind-mounts becauseo one is using openssh's sftp-chroot to replace FTP, i was th eone complaining

> for shortest one device name people complain

because it is wrong

> first come first serve - people complain

who complains here?

the first one *non bind-mount* is the primary device
in case of "df" == disk free i want this one, only once
not a random bind-mount *using* that one in /etc/fstab

treating my /mnt/data as /tmp in df-output is questionable to say it polite sicne /tmp is a bind-mount to /mnt/data/.tmp and i am for sure not the only person acting this way to prevent from TmpOnTmpfs in case of machines with no need for a dediacted /tmp-partition and not want it on rootfs for well known reasons

> Coreutils are written to be portable

that's fine - but IMHO the job of a *distribution* is to give a useful behavior for it's core commands - in Fedora 18 this was done right and from Fedora 19/20 to RHEL7 it is broken again, well not that broken as in Fedora 15 with listing all bind-mounts but still a step backwards from F18 behavior

Comment 6 Harald Reindl 2013-12-18 22:09:37 UTC
> I haven't introduced the mtab symlink - you know who did

kernel upstream, but i am pretty sure they did not expect that userland-software like "df" is rocket science not able to cope with it beause all needed system informations are present and kernel-upstream has it's focus on Linux

Comment 7 Ondrej Vasik 2013-12-18 22:27:26 UTC
(In reply to Harald Reindl from comment #5)
> who complains here?
> 
> the first one *non bind-mount* is the primary device
> in case of "df" == disk free i want this one, only once
> not a random bind-mount *using* that one in /etc/fstab

https://bugzilla.redhat.com/show_bug.cgi?id=709351#c31

There started the way of "first come, first serve" - which worked for the bind mounts quite well, but had other issues...

Comment 8 Ondrej Vasik 2013-12-18 22:32:21 UTC
I meant the way to "silicon heaven"... later on, on upstream mailing list, the current approach was chosen as the "best one". Still - it doesn't work correctly for some types of bindmounts...

Comment 9 Ludek Smid 2014-06-26 10:50:23 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.

Comment 10 Harald Reindl 2014-06-26 10:58:15 UTC
well, can we have this fix for Fedora too where this issue exists for years now with a short timeframe where it was fixed

/dev/md2 is *not* /tmp

/mnt/data/.tmp               /tmp                                    none  bind
/mnt/data/.tmp               /var/tmp                                none  bind


Filesystem     Type  Size  Used Avail Use% Mounted on
/dev/md1       ext4   29G  6.5G   23G  23% /
/dev/md0       ext4  485M   37M  444M   8% /boot
/dev/md2       ext4  3.6T  2.1T  1.5T  60% /tmp

Comment 11 Ludek Smid 2014-06-26 11:16:29 UTC
The comment above is incorrect. The correct version is bellow.
I'm sorry for any inconvenience.
---------------------------------------------------------------

This request was NOT resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you need
to escalate this bug.

Comment 15 Kamil Dudka 2016-10-12 14:31:37 UTC
Note this is now fixed in Fedora.  See bug #1001092 for details.

Comment 16 Kamil Dudka 2016-10-12 14:32:36 UTC
*** Bug 1261032 has been marked as a duplicate of this bug. ***

Comment 17 Kamil Dudka 2017-05-12 09:58:03 UTC
*** Bug 1450229 has been marked as a duplicate of this bug. ***

Comment 21 Kamil Dudka 2018-11-15 09:36:59 UTC
*** Bug 1650045 has been marked as a duplicate of this bug. ***

Comment 28 errata-xmlrpc 2019-08-06 13:06:19 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2019:2217


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