GNU bug report logs - #28991
df: wrong output when a FS masks another one

Previous Next

Package: coreutils;

Reported by: Stephane Chazelas <stephane.chazelas <at> gmail.com>

Date: Wed, 25 Oct 2017 14:58:01 UTC

Severity: wishlist

Merged with 28670

To reply to this bug, email your comments to 28991 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-coreutils <at> gnu.org:
bug#28991; Package coreutils. (Wed, 25 Oct 2017 14:58:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stephane Chazelas <stephane.chazelas <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Wed, 25 Oct 2017 14:58:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Stephane Chazelas <stephane.chazelas <at> gmail.com>
To: bug-coreutils <at> gnu.org
Subject: df: wrong output when a FS masks another one
Date: Wed, 25 Oct 2017 15:57:15 +0100
Test case:

/tmp$ mkdir -p 1/2
/tmp$ sudo mount -o size=1M -t tmpfs x 1/2
/tmp$ sudo mount -o size=2M -t tmpfs y 1
/tmp$ mkdir 1/2
/tmp$ df -h 1/2
Filesystem      Size  Used Avail Use% Mounted on
x               2.0M     0  2.0M   0% /tmp/1/2

The Size is correct as that's obtained from statfs() on the
file. But when it comes to finding the corresponding mount
source and mountpoint, it fails.

/tmp$ grep /tmp/ /proc/mounts
x /tmp/1/2 tmpfs rw,relatime,size=1024k 0 0
y /tmp/1 tmpfs rw,relatime,size=2048k 0 0

df should walk /proc/self/mounts or /etc/mtab from the bottom up
until it finds the first mount point that is a parent of the
realpath of the file.

/tmp$ df --version
df (GNU coreutils) 8.28

(on Debian testing amd64)


Related: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=15955

That's just been discussed on the austin group mailing list:
https://www.mail-archive.com/austin-group-l <at> opengroup.org/msg01715.html
https://www.mail-archive.com/austin-group-l <at> opengroup.org/msg01720.html

Not critical as that could be considered as a pathological test
case.

-- 
Stephane




Information forwarded to bug-coreutils <at> gnu.org:
bug#28991; Package coreutils. (Thu, 26 Oct 2017 04:49:02 GMT) Full text and rfc822 format available.

Message #8 received at 28991 <at> debbugs.gnu.org (full text, mbox):

From: Pádraig Brady <P <at> draigBrady.com>
To: Stephane Chazelas <stephane.chazelas <at> gmail.com>, 28991 <at> debbugs.gnu.org,
 28670 <at> debbugs.gnu.org
Subject: Re: bug#28991: df: wrong output when a FS masks another one
Date: Wed, 25 Oct 2017 21:48:09 -0700
On 25/10/17 07:57, Stephane Chazelas wrote:
> Test case:
> 
> /tmp$ mkdir -p 1/2
> /tmp$ sudo mount -o size=1M -t tmpfs x 1/2
> /tmp$ sudo mount -o size=2M -t tmpfs y 1
> /tmp$ mkdir 1/2
> /tmp$ df -h 1/2
> Filesystem      Size  Used Avail Use% Mounted on
> x               2.0M     0  2.0M   0% /tmp/1/2
> 
> The Size is correct as that's obtained from statfs() on the
> file. But when it comes to finding the corresponding mount
> source and mountpoint, it fails.
> 
> /tmp$ grep /tmp/ /proc/mounts
> x /tmp/1/2 tmpfs rw,relatime,size=1024k 0 0
> y /tmp/1 tmpfs rw,relatime,size=2048k 0 0
> 
> df should walk /proc/self/mounts or /etc/mtab from the bottom up
> until it finds the first mount point that is a parent of the
> realpath of the file.
> 
> /tmp$ df --version
> df (GNU coreutils) 8.28
> 
> (on Debian testing amd64)
> 
> 
> Related: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=15955
> 
> That's just been discussed on the austin group mailing list:
> https://www.mail-archive.com/austin-group-l <at> opengroup.org/msg01715.html
> https://www.mail-archive.com/austin-group-l <at> opengroup.org/msg01720.html
> 
> Not critical as that could be considered as a pathological test
> case.
> 

Yes it would be nice to behave more consistently here.
Also related is https://bugs.gnu.org/28670

cheers,
Pádraig




Severity set to 'wishlist' from 'normal' Request was from Assaf Gordon <assafgordon <at> gmail.com> to control <at> debbugs.gnu.org. (Tue, 30 Oct 2018 01:42:03 GMT) Full text and rfc822 format available.

Merged 28670 28991. Request was from Assaf Gordon <assafgordon <at> gmail.com> to control <at> debbugs.gnu.org. (Tue, 30 Oct 2018 01:42:03 GMT) Full text and rfc822 format available.

This bug report was last modified 6 years and 229 days ago.

Previous Next


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