GNU bug report logs - #16539
df command, possible bug?

Previous Next

Package: coreutils;

Reported by: crubel <at> compro.net

Date: Fri, 24 Jan 2014 20:39:01 UTC

Severity: normal

Done: Bernhard Voelker <mail <at> bernhard-voelker.de>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Pádraig Brady <P <at> draigBrady.com>
To: 16539 <at> debbugs.gnu.org
Subject: bug#16539: More details on df command output for you
Date: Tue, 17 Jun 2014 17:03:39 +0100
[Message part 1 (text/plain, inline)]
On 05/13/2014 11:20 PM, Bernhard Voelker wrote:
> On 05/12/2014 05:10 PM, Pádraig Brady wrote:
>> I've attached 4 patches for df to:
>>
>>     df: also deduplicate virtual file systems
>>     df: fix handling of symlinks in mount list
>>     df: ignore non file system entries in /proc/mounts
>>     maint: avoid clang -Wtautological-constant-out-of-range-compare warning
> 
> They are look good to me - great work, thanks!
> AFAIR, the last one was also warned about by Coverity (but
> I can't check now as their website is down for maintenance).
> 
>> Not included is your "overmount change" or the "d)" adjustment above,
>> as I was unsure how you wanted to handle exactly.
> 
> To recap, this was the problem:
> 
>   $ mount /dev/sda5 /tmp/mnt
>   $ mount -o loop tmp.img /tmp/mnt
> 
> df - even including your 4 patches - shows wrong results:
> 
>   $ src/df | grep mnt
>   /dev/sda5          59365      1308     53471   3% /tmp/mnt
> 
>   $ src/df -a | grep mnt
>   /dev/sda5          59365      1308     53471   3% /tmp/mnt
>   /dev/loop0         59365      1308     53471   3% /tmp/mnt
> 
> The idea was to trust the order of /proc/mounts
> 
>   $ tail -n2 /proc/mounts
>   /dev/sda5 /tmp/mnt ext2 rw,relatime 0 0
>   /dev/loop0 /tmp/mnt ext3 rw,relatime,data=ordered 0 0
> 
> i.e., loop through the mount list leaving only the
> last unique (maybe canonicalized) mount point.
> 
> Another special case is when a mount point is not reachable
> at all anymore:
> 
>   /dev/sda5 /tmp/mnt/some/subdir ext2 rw,relatime 0 0
>   /dev/loop0 /tmp/mnt ext3 rw,relatime,data=ordered 0 0
> 
> I recommend discarding eclipsed mounts in normal output,
> and output "-" values with -a.

The attached (on top of df-fix-last-device.diff) should
put "-" placeholder values in the needed cases.

That should be it for df fixes for coreutils-8.23.

cheers,
Pádraig.
[df-fix-wrong-device.diff (text/x-patch, attachment)]

This bug report was last modified 10 years and 333 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.