bug#15955: df hides original mount point instead of bind mount
On 11/24/2013 02:08 AM, Phillip Susi wrote: > On 11/22/2013 08:11 PM, Bernhard Voelker wrote: >> Thanks for the bug report. >> However, IIRC that behavior was fixed in v8.21. Since then, df(1) >> shows the *shortest* mount point for the same bind mount. >> Looking into the Fedora bug tracker, this method of reducing duplicates >> among (possibly mass) bind mounts seems also not to have too many fans, >> but until now we didn't find a better method. > > Yes, that explains it; I had bound a longer path to /mnt to test. > Why not show the oldest mount point instead? 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). Have a nice day, Berny
bug#15955: df hides original mount point instead of bind mount
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 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. -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.14 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCgAGBQJSkovxAAoJEJrBOlT6nu75zPkH/jKoyhDSgjSihw1lIIueSkL0 jHv/Y3ZhUx+mykzxMO4ssPqWaknzgB2HNoFz5U7NcSmUvNyTX9Zt39ZBYJnxqOdb HOLNxq1vpy2yDk0frHdEH/VEfdnN9D1bniR93uRxW/j8KoFv+i16P34MX+3cQF8M F/clayut55pSL+NnSVrGLB6eGAyJYEDsoiuq+SBxYO5Tt6zmS1jb7e/ORWdZuwE5 td9snMTLkolB/YqvawsQFHwYCzWbOukC7g7DUKIK85tQnFopqdXb8kSh0O42tdig xFzkFP8+5np6O1GAPmDVPxX7cpjy8Pw7S0bYg9rr6YF3WeNTwpI9nBWM/AjTpCY= =QYXB -END PGP SIGNATURE-
bug#15955: df hides original mount point instead of bind mount
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 ' /$' rootfs12095032 798 3491744 70% / /dev/sda1 12095032 798 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
bug#15955: df hides original mount point instead of bind mount
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 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 ' /$' rootfs12095032 798 > 3491744 70% / /dev/sda1 12095032 798 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. -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.14 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCgAGBQJSlU+JAAoJEI5FoCIzSKrwJnEH/jYK117dsdMOQWJsSBqYIRUD fI4ilZjsTPb5n49dlsN4oXI/phzdFvGTKdw3LRNYv2MJhG2KcQScIRqIgV4OT+Rr 9RsRAHtvGF7j89AtdKbu4HVQlFm450WrqAsReg9vnjCrj6q57Ms/CXp4GNHDu1HD JaNZ/8XlpLAsJR9rz62+R1GCqQF4yZbwRDgudy8gxG1OcXmO24Wk6SE03Q0Ss8Ho QFSreq9Bpzs4l/BAkqLuAXJAMBHX5gQ1R/URbHv+m3mW6RnCVryjSQmOGd7+wWRn Y6ttY+OGU9334ckwfsJ4lD448fY2/81ty89NhrkKPuXwZbUj1ocJiZK8SWyfcAE= =pAtS -END PGP SIGNATURE-