Subject: Re: bug#15955: df hides original mount point instead of bind mount

From: Bernhard Voelker <[email-masked]>
Date: Wed, 27 Nov 2013 00:37:54 +0100

On 11/25/2013 12:29 AM, Phillip Susi wrote:
> On 11/24/2013 05:24 AM, Bernhard Voelker wrote:
>> Thanks for the suggestion, but that is not possible.  For the kernel,
>> all bind mounts are actually equal among each other, and there's no
>> information about "bind" flags in /proc/self/mounts (which 'df' uses).
> 
> I'm aware of that, but the order they are reported in /proc/mounts at
> least seems to be the order they were mounted in, which seems like it
> would be a better thing to decide which to show and hide than the
> length of the path.

As already mentioned, the current implementation is not ideal.
It is a compromise between the requirements which hit 'df' at that time:

* showing the real root file system instead of early-boot rootfs:

  $ src/df -a | grep ' /$'
  rootfs            12095032   7988888   3491744  70% /
  /dev/sda1         12095032   7988888   3491744  70% /

* suppressing massive bind-mounts with hundreds or thousands of bind
  mounts of the same file system:

    $ for f in $(seq 1000) ; do
        mkdir dir$f \
          && mount -o bind /etc dir$f ; \
      done
  and then look at 'df' vs. 'df -a'.

* IIRC there was a another issue re. shortening mount information like:
  /dev/disk/by-id/scsi-SATA_Hitachi_HDS7210_JP2911N03AR0WV-part1

This has to be discussed in the context of Fedora's currently open
bug reports.

Thanks & have a nice day,
Berny