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

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: coreutils; Severity: wishlist; Reported by: Stephane Chazelas <stephane.chazelas@HIDDEN>; merged with #28670; dated Wed, 25 Oct 2017 14:58:01 UTC; Maintainer for coreutils is bug-coreutils@HIDDEN.
Merged 28670 28991. Request was from Assaf Gordon <assafgordon@HIDDEN> to control <at> debbugs.gnu.org. Full text available.
Severity set to 'wishlist' from 'normal' Request was from Assaf Gordon <assafgordon@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 28991 <at> debbugs.gnu.org:


Received: (at 28991) by debbugs.gnu.org; 26 Oct 2017 04:48:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Oct 26 00:48:14 2017
Received: from localhost ([127.0.0.1]:33831 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1e7a5W-00016s-LK
	for submit <at> debbugs.gnu.org; Thu, 26 Oct 2017 00:48:14 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:35058)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <P@HIDDEN>)
 id 1e7a5U-00016d-SL; Thu, 26 Oct 2017 00:48:13 -0400
Received: from localhost.localdomain (c-73-158-116-184.hsd1.ca.comcast.net
 [73.158.116.184])
 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
 (No client certificate requested)
 by mail.magicbluesmoke.com (Postfix) with ESMTPSA id 80ADD9C32;
 Thu, 26 Oct 2017 05:48:11 +0100 (IST)
Subject: Re: bug#28991: df: wrong output when a FS masks another one
To: Stephane Chazelas <stephane.chazelas@HIDDEN>, 28991 <at> debbugs.gnu.org,
 28670 <at> debbugs.gnu.org
References: <20171025145715.GE5071@HIDDEN>
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@HIDDEN>
Message-ID: <35fc7d85-351d-f496-644b-0c78af40e105@HIDDEN>
Date: Wed, 25 Oct 2017 21:48:09 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
 Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <20171025145715.GE5071@HIDDEN>
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 28991
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.0 (/)

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@HIDDEN/msg01715.html
> https://www.mail-archive.com/austin-group-l@HIDDEN/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




Information forwarded to bug-coreutils@HIDDEN:
bug#28991; Package coreutils. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 25 Oct 2017 14:57:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Oct 25 10:57:33 2017
Received: from localhost ([127.0.0.1]:33460 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1e7N7d-0002In-DU
	for submit <at> debbugs.gnu.org; Wed, 25 Oct 2017 10:57:33 -0400
Received: from eggs.gnu.org ([208.118.235.92]:34095)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <stephane.chazelas@HIDDEN>) id 1e7N7a-0002Ia-NE
 for submit <at> debbugs.gnu.org; Wed, 25 Oct 2017 10:57:30 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <stephane.chazelas@HIDDEN>) id 1e7N7U-0004rc-Hi
 for submit <at> debbugs.gnu.org; Wed, 25 Oct 2017 10:57:25 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,
 T_DKIM_INVALID autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:39005)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <stephane.chazelas@HIDDEN>)
 id 1e7N7U-0004rF-DU
 for submit <at> debbugs.gnu.org; Wed, 25 Oct 2017 10:57:24 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:53280)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <stephane.chazelas@HIDDEN>) id 1e7N7T-0001u7-3j
 for bug-coreutils@HIDDEN; Wed, 25 Oct 2017 10:57:24 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <stephane.chazelas@HIDDEN>) id 1e7N7P-0004ki-Tv
 for bug-coreutils@HIDDEN; Wed, 25 Oct 2017 10:57:23 -0400
Received: from mail-wr0-x22b.google.com ([2a00:1450:400c:c0c::22b]:50047)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
 (Exim 4.71) (envelope-from <stephane.chazelas@HIDDEN>)
 id 1e7N7P-0004jQ-NG
 for bug-coreutils@HIDDEN; Wed, 25 Oct 2017 10:57:19 -0400
Received: by mail-wr0-x22b.google.com with SMTP id g90so281531wrd.6
 for <bug-coreutils@HIDDEN>; Wed, 25 Oct 2017 07:57:19 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=date:from:to:subject:message-id:mime-version:content-disposition
 :user-agent; bh=oZJhfkjOvWFkYOpj71LsBffwlSDPU9RlRftd2Y57+3g=;
 b=YdheHOZz5yskkEHfizaHcvMFkcoXRCoqwKTmGLg4EuAC41xVuR2wEWvDl1fMchqUlz
 aFN/2eOQw2zptQo5xUQUuemAyTW7Q9SdOv6hM+LGjB5focrBDGzN3wPk75ZcImwCeAW/
 zR3IUm7UwL1QAORH0ktJ+E/QkUNt0abFyfwuGREVzll2lJMmdM7n4v1d71CTqzQEsfRh
 n8LoiWBHFbM7pFDhYfRtyza9QfBvKEQVzgcmJFlSLKDdoLQ/r7CFURZyeyaylU5YcbzX
 T96cwHg4mm8QDQyGd61KPLj0O7vkoSyrZ8AJ4cm4c2kzloMHwIOn8iR4tsM4bq0Q2b5V
 u9qQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:date:from:to:subject:message-id:mime-version
 :content-disposition:user-agent;
 bh=oZJhfkjOvWFkYOpj71LsBffwlSDPU9RlRftd2Y57+3g=;
 b=Vq2Zrpndt++svCSQ1e6UyAN64e/ltYDB++gC7kGGZpXA0/FIOn2sGxY90Td7eUDi9S
 sNWJmC7vRCp32v6g6RyCTPs1y4bC745YTG7KqIGCGcEIgE2yXpv0v1YbRRLySgogXEXr
 OvTjm/IzPKUq/D0McxQqUKFN8L7AstR6kjiZBqtdTPgcab95kJI+xHglxs3mJDAzlRXm
 c44LJwdtML5WIlsJqHSz8sa6UZr3ooP7kSrshLE3xtNg4yspTbQYGVYu5c7vl7drnuWF
 HHsineN08hPme7wYRXg44nqp2f9Kv3gZ7Iydukn1gXRuy/3dL9XyCw3XvmgWhO229PZy
 Tlxg==
X-Gm-Message-State: AMCzsaU2XOtlvKLViKTCAKo8PzTvlqtJpe0jCvo9TOVCyoKFC//O9gIh
 7Vi17uGiLmfM/MzDoGdNhVZvYQ==
X-Google-Smtp-Source: ABhQp+S2J0jbj6fQKT7cVyiG26b+HHyFdn+BUjBQi4yTYCZ/rGofuLNVDTEbqe+rM+3o5xN4sdPQOQ==
X-Received: by 10.223.160.161 with SMTP id m30mr2498144wrm.27.1508943437841;
 Wed, 25 Oct 2017 07:57:17 -0700 (PDT)
Received: from chaz.gmail.com ([90.198.158.87])
 by smtp.gmail.com with ESMTPSA id c3sm2609016wrd.44.2017.10.25.07.57.15
 for <bug-coreutils@HIDDEN>
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Wed, 25 Oct 2017 07:57:16 -0700 (PDT)
Date: Wed, 25 Oct 2017 15:57:15 +0100
From: Stephane Chazelas <stephane.chazelas@HIDDEN>
To: bug-coreutils@HIDDEN
Subject: df: wrong output when a FS masks another one
Message-ID: <20171025145715.GE5071@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.5.24 (2015-08-30)
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
 recognized.
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -4.0 (----)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -4.0 (----)

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@HIDDEN/msg01715.html
https://www.mail-archive.com/austin-group-l@HIDDEN/msg01720.html

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

-- 
Stephane




Acknowledgement sent to Stephane Chazelas <stephane.chazelas@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-coreutils@HIDDEN. Full text available.
Report forwarded to bug-coreutils@HIDDEN:
bug#28991; Package coreutils. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 25 Nov 2019 12:00:02 UTC

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