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

From: Phillip Susi <[email-masked]>
Date: Tue, 26 Nov 2013 20:48:57 -0500

On 11/26/2013 06:37 PM, Bernhard Voelker wrote:
> 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%
> /

That doesn't seem to be at all related since the path on both is
exactly the same, not one longer than the other, and is filtered by
the fstype being "rootfs".  For that matter, this has always seemed
like a bug in the kernel to me: rootfs isn't mounted in /, it is
mounted above / and therefore is not visible to this process, so it
shouldn't be shown in /proc/mounts.

> * 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'.

Yes, the whole topic is hiding bind mounts; the question is how to
choose which one to hide.  Why use the path length instead of which
was mounted first?

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

Again, that seems totally unrelated.  The by-id is a symlink so it is
followed to the underlying devnode and that's what is reported in
/proc/mounts, and it doesn't have anything to do with the length of
the mount point.