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

Full log


View this message in rfc822 format

From: Stephane Chazelas <stephane.chazelas <at> gmail.com>
To: 28991 <at> debbugs.gnu.org
Subject: bug#28991: 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




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

Previous Next


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