From unknown Sun Jun 22 11:42:36 2025 X-Loop: help-debbugs@gnu.org Subject: bug#19570: bug: df and bind mounts Resent-From: Vladimir A. Pavlov Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Sun, 11 Jan 2015 23:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 19570 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: 19570@debbugs.gnu.org X-Debbugs-Original-To: bug-coreutils@gnu.org Reply-To: Vladimir A. Pavlov Received: via spool by submit@debbugs.gnu.org id=B.142102039711237 (code B ref -1); Sun, 11 Jan 2015 23:54:02 +0000 Received: (at submit) by debbugs.gnu.org; 11 Jan 2015 23:53:17 +0000 Received: from localhost ([127.0.0.1]:42967 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YASJn-0002v7-6D for submit@debbugs.gnu.org; Sun, 11 Jan 2015 18:53:16 -0500 Received: from eggs.gnu.org ([208.118.235.92]:57496) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YAS3q-0002G5-6G for submit@debbugs.gnu.org; Sun, 11 Jan 2015 18:36:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YAS3o-0002AR-Uh for submit@debbugs.gnu.org; Sun, 11 Jan 2015 18:36:46 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: * X-Spam-Status: No, score=1.8 required=5.0 tests=BAYES_50,FROM_EXCESS_BASE64, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:43543) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YAS3o-0002AN-Rv for submit@debbugs.gnu.org; Sun, 11 Jan 2015 18:36:44 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59211) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YAS3n-0001fC-Qj for bug-coreutils@gnu.org; Sun, 11 Jan 2015 18:36:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YAS3k-00029m-Fb for bug-coreutils@gnu.org; Sun, 11 Jan 2015 18:36:43 -0500 Received: from f387.i.mail.ru ([185.5.136.58]:43763) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YAS3j-00029L-W4 for bug-coreutils@gnu.org; Sun, 11 Jan 2015 18:36:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=bk.ru; s=mail; h=Content-Type:Message-ID:Reply-To:Date:MIME-Version:Subject:To:From; bh=VvkD1OdMZVbwKQLBN1bnJeix0ER2pFgqFKwFfQQuYdI=; b=Hs//jiLwegJSKSVSYGoCi5NHDv/y7VMupT1QUoUhN1cHqTuV29jVk3v4f3BZ7n5H0SPlsJdU0c8KQHgAn7xAAa4gMau97uQuoZOjFvZMHXDNrZB+LBGtDm0HM3kXbZCxWQoxoMPQBHx7FMYZFo2j5wMg+Mkjo7su/K/6bEPDodk=; Received: from [128.75.172.33] (ident=mail) by f387.i.mail.ru with local (envelope-from ) id 1YAS3h-0004ub-B1 for bug-coreutils@gnu.org; Mon, 12 Jan 2015 02:36:38 +0300 Received: from [128.75.172.33] by e.mail.ru with HTTP; Mon, 12 Jan 2015 02:36:37 +0300 From: Vladimir A. Pavlov MIME-Version: 1.0 X-Mailer: Mail.Ru Mailer 1.0 X-Originating-IP: [128.75.172.33] Date: Mon, 12 Jan 2015 02:36:37 +0300 X-Priority: 3 (Normal) Message-ID: <1421019397.984376339@f387.i.mail.ru> Content-Type: multipart/mixed; boundary="----XbyFP4rp66ey0lKGrt6tcKFQfSP53gWh-anAA5WAW0kKpitkx:1421019397" X-Mras: Ok X-Spam: undefined X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -3.9 (---) X-Mailman-Approved-At: Sun, 11 Jan 2015 18:53:13 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.9 (---) ------XbyFP4rp66ey0lKGrt6tcKFQfSP53gWh-anAA5WAW0kKpitkx:1421019397 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: base64 SGVsbG8sCgpJIGhhdmUgYW4gaXNzdWUgd2l0aCBkZiAoYm90aCBpbiB2ZXJzaW9uIDguMjMgYW5k IGluIG1hc3RlciBicmFuY2gpLgoKSSBoYXZlIHRtcGZzIG1vdW50ZWQgYXMgL3J1biAuIFRoZXJl IGlzIC9ydW4vY2dzL2h0dHBkIHN1YmRpcmVjdG9yeSBpbgovcnVuIChqdXN0IGEgc3ViZGlyZWN0 b3J5LCBub3QgYSB0bXBmcyBvciBhbm90aGVyIG1vdW50KS4gVGhpcwovcnVuL2Nncy9odHRwZCBp cyBiaW5kLW1vdW50ZWQgdG8gL3Vzci9jZ3MvaHR0cGQvcnVuLgoKVGhlIGN1cnJlbnQgYWxnb3Jp dGhtIGluIGRmLmM6ZmlsdGVyX21vdW50X2xpc3QoKSBjaG9vc2VzIHRoZSBiaW5kCm1vdW50cG9p bnQgc2luY2UgaXQgaGFzIHRoZSBsZWFkaW5nIHNsYXNoIGluIHRoZSAiZGV2aWNlIiBuYW1lCigi L3J1bi9jZ3MvaHR0cGQiIHZzICJydW4iKSB3aGljaCBpcyB3cm9uZyBpbiBteSBzZXR1cC4KClRo ZSBzaW1pbGFyIChidXQgbm90IHRoZSBzYW1lKSBpc3N1ZSBpcyBmaXhlZCBieSBjb21taXQ6Cmh0 dHA6Ly9naXQuc2F2YW5uYWguZ251Lm9yZy9jZ2l0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y29yZXV0aWxzLTguMjMtZGZfYmluZG1vdW50X2ZpeC5wYXRjaA==?=" Content-Disposition: attachment Content-Transfer-Encoding: base64 LS0tIGNvcmV1dGlscy1naXQub3JpZy9zcmMvZGYuYwkyMDE1LTAxLTEyIDAxOjQ2OjQ4LjAwMDAw MDAwMCArMDMwMAorKysgY29yZXV0aWxzLWdpdC9zcmMvZGYuYwkyMDE1LTAxLTEyIDAyOjA4OjEx LjE5MDAxMjIwNyArMDMwMApAQCAtNjUwLDcgKzY1MCw4IEBAIGZpbHRlcl9tb3VudF9saXN0IChi b29sIGRldmljZXNfb25seSkKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgIGVsc2Ug aWYgKChzdHJjaHIgKG1lLT5tZV9kZXZuYW1lLCAnLycpCiAgICAgICAgICAgICAgICAgICAgICAg IC8qIGxldCAicmVhbCIgZGV2aWNlcyB3aXRoICcvJyBpbiB0aGUgbmFtZSB3aW4uICAqLwotICAg ICAgICAgICAgICAgICAgICAgICAgJiYgISBzdHJjaHIgKGRldmxpc3QtPm1lLT5tZV9kZXZuYW1l LCAnLycpKQorICAgICAgICAgICAgICAgICAgICAgICAgJiYgISBzdHJjaHIgKGRldmxpc3QtPm1l LT5tZV9kZXZuYW1lLCAnLycpCisgICAgICAgICAgICAgICAgICAgICAgICAmJiBTVFJFUSAobWUt Pm1lX21vdW50ZGlyLCBkZXZsaXN0LT5tZS0+bWVfbW91bnRkaXIpKQogICAgICAgICAgICAgICAg ICAgICAgICAvKiBsZXQgYSBzaG9ydGVyIG1vdW50ZGlyIHdpbi4gICovCiAgICAgICAgICAgICAg ICAgICAgICAgIHx8IChzdHJsZW4gKGRldmxpc3QtPm1lLT5tZV9tb3VudGRpcikKICAgICAgICAg ICAgICAgICAgICAgICAgICAgID4gc3RybGVuIChtZS0+bWVfbW91bnRkaXIpKQo= ------XbyFP4rp66ey0lKGrt6tcKFQfSP53gWh-anAA5WAW0kKpitkx:1421019397-- From unknown Sun Jun 22 11:42:36 2025 X-Loop: help-debbugs@gnu.org Subject: bug#19570: bug: df and bind mounts Resent-From: =?UTF-8?Q?P=C3=A1draig?= Brady Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Mon, 12 Jan 2015 01:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19570 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: "Vladimir A. Pavlov" , 19570@debbugs.gnu.org Received: via spool by 19570-submit@debbugs.gnu.org id=B19570.14210262937157 (code B ref 19570); Mon, 12 Jan 2015 01:32:02 +0000 Received: (at 19570) by debbugs.gnu.org; 12 Jan 2015 01:31:33 +0000 Received: from localhost ([127.0.0.1]:53883 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YATqs-0001oX-GY for submit@debbugs.gnu.org; Sun, 11 Jan 2015 20:31:31 -0500 Received: from mail1.vodafone.ie ([213.233.128.43]:32690) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YATqo-0001cP-Qy for 19570@debbugs.gnu.org; Sun, 11 Jan 2015 20:31:27 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AooPAPYis1RtT4+z/2dsb2JhbABbgwZSWAGCNU/CeoVqAQICgQlDAQEBAQF9hA0BBSMPAVYLDQsCAgUWCwICCQMCAQIBRQYBDAgBARqIEgEItxeFaY01DCCBIYxLgVo6gmiBQQWSAot4i0gig24+MQEBAQKCPgEBAQ Received: from unknown (HELO localhost.localdomain) ([109.79.143.179]) by mail1.vodafone.ie with ESMTP; 12 Jan 2015 01:31:19 +0000 Message-ID: <54B323E7.6000204@draigBrady.com> Date: Mon, 12 Jan 2015 01:31:19 +0000 From: =?UTF-8?Q?P=C3=A1draig?= Brady User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 References: <1421019397.984376339@f387.i.mail.ru> In-Reply-To: <1421019397.984376339@f387.i.mail.ru> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) On 11/01/15 23:36, Vladimir A. Pavlov wrote: > Hello, > > I have an issue with df (both in version 8.23 and in master branch). > > I have tmpfs mounted as /run . There is /run/cgs/httpd subdirectory in > /run (just a subdirectory, not a tmpfs or another mount). This > /run/cgs/httpd is bind-mounted to /usr/cgs/httpd/run. > > The current algorithm in df.c:filter_mount_list() chooses the bind > mountpoint since it has the leading slash in the "device" name > ("/run/cgs/httpd" vs "run") which is wrong in my setup. > > The similar (but not the same) issue is fixed by commit: > http://git.savannah.gnu.org/cgit/coreutils.git/commit/src/df.c?id=ed1a495b3ccb2665a13229ca866f2115bd768d17 > > I guess the "let real devices with / in the name win" replacement branch > should only be applied if mountpoints are the same as well. > > Below is the data to reproduce the bug. > > === /etc/mtab (partial) === > run /run tmpfs rw,noatime,nodiratime,nodev,noexec,mode=0755,size=1m 0 0 > /run/cgs/httpd /usr/cgs/httpd/run none rw,bind 0 0 > ====== > > === Real output (git) === > Filesystem Size Used Avail Use% Mounted on > /run/cgs/httpd 1.0M 8.0K 1016K 1% /usr/cgs/httpd/run > ====== > > === Expected output (with the attached patch applied) === > Filesystem Size Used Avail Use% Mounted on > run 1.0M 8.0K 1016K 1% /run > ====== > Thanks for the analysis and patch, Current tests pass at least with it. I'll analyse a little more, add tests and probably push. thanks! Pádraig. From unknown Sun Jun 22 11:42:36 2025 X-Loop: help-debbugs@gnu.org Subject: bug#19570: bug: df and bind mounts Resent-From: Bernhard Voelker Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Mon, 12 Jan 2015 21:28:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19570 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: =?UTF-8?Q?P=C3=A1draig?= Brady , "Vladimir A. Pavlov" , 19570@debbugs.gnu.org Received: via spool by 19570-submit@debbugs.gnu.org id=B19570.142109804830141 (code B ref 19570); Mon, 12 Jan 2015 21:28:01 +0000 Received: (at 19570) by debbugs.gnu.org; 12 Jan 2015 21:27:28 +0000 Received: from localhost ([127.0.0.1]:54779 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YAmWG-0007q5-89 for submit@debbugs.gnu.org; Mon, 12 Jan 2015 16:27:28 -0500 Received: from mout.kundenserver.de ([212.227.17.24]:64867) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YAmWE-0007pp-7E for 19570@debbugs.gnu.org; Mon, 12 Jan 2015 16:27:26 -0500 Received: from [192.168.1.10] ([84.175.86.9]) by mrelayeu.kundenserver.de (mreue101) with ESMTPSA (Nemesis) id 0Mbyf0-1YRth60oQo-00JLr8; Mon, 12 Jan 2015 22:27:14 +0100 Message-ID: <54B43C31.6050103@bernhard-voelker.de> Date: Mon, 12 Jan 2015 22:27:13 +0100 From: Bernhard Voelker User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 References: <1421019397.984376339@f387.i.mail.ru> <54B323E7.6000204@draigBrady.com> In-Reply-To: <54B323E7.6000204@draigBrady.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:r8EmyzVQztW86nBwTY9Q6Y2CUREGYGHxI/SEYh/IJk97pcYGomV sPaYoPYEGfM8u49q3lYnedMcwdQaTl1InYPkNEzfJIVJxiVXtR5aqmbrqmd/t/jX7PI6Cfl HKn0AgnGU6kFvgxNwQJq9/xv59ANxXhSTUglmEyWvpzBU1qOEgjkBlWogjjWVcYmwe6MzkM DWaU6b9FGXkHpfnbVOG0Q== X-UI-Out-Filterresults: notjunk:1; X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) On 01/12/2015 02:31 AM, Pádraig Brady wrote: > On 11/01/15 23:36, Vladimir A. Pavlov wrote: >> run /run tmpfs rw,noatime,nodiratime,nodev,noexec,mode=0755,size=1m 0 0 >> /run/cgs/httpd /usr/cgs/httpd/run none rw,bind 0 0 > Thanks for the analysis and patch, > Current tests pass at least with it. > I'll analyse a little more, add tests and probably push. hmm, tmpfs is problematic anyway, as one can specify anything as the dummy backing source device: $ mount -t tmpfs hello:/world /mnt $ mount -t tmpfs something /mnt $ mount -t tmpfs / /mnt $ findmnt /mnt TARGET SOURCE FSTYPE OPTIONS /mnt hello:/world tmpfs rw,relatime /mnt something tmpfs rw,relatime /mnt / tmpfs rw,relatime $ df -a --out=source,target | grep /mnt hello:/world /mnt something /mnt / /mnt I'd almost tend to recommend to classify tmpfs as dummy file system like procfs etc. Have a nice day, Berny From unknown Sun Jun 22 11:42:36 2025 X-Loop: help-debbugs@gnu.org Subject: bug#19570: bug: df and bind mounts Resent-From: =?UTF-8?Q?P=C3=A1draig?= Brady Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Mon, 12 Jan 2015 23:05:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19570 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: Bernhard Voelker , "Vladimir A. Pavlov" , 19570@debbugs.gnu.org Received: via spool by 19570-submit@debbugs.gnu.org id=B19570.14211038547009 (code B ref 19570); Mon, 12 Jan 2015 23:05:01 +0000 Received: (at 19570) by debbugs.gnu.org; 12 Jan 2015 23:04:14 +0000 Received: from localhost ([127.0.0.1]:54800 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YAo1u-0001oy-7T for submit@debbugs.gnu.org; Mon, 12 Jan 2015 18:04:14 -0500 Received: from mail4.vodafone.ie ([213.233.128.170]:55289) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YAo1r-0001ol-L7 for 19570@debbugs.gnu.org; Mon, 12 Jan 2015 18:04:12 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjoFAL5RtFRtTcm8/2dsb2JhbABbgwZSg13GJ4JPAoEOQwEBAQEBfYQNAQUjDwFWCw0BCgICBRYLAgIJAwIBAgFFBgEMCAEBiCwBuC6FaY1+AQsggSGOD1CCaIFBBZ16i0gig24+gTWBPwEBAQ Received: from unknown (HELO localhost.localdomain) ([109.77.201.188]) by mail3.vodafone.ie with ESMTP; 12 Jan 2015 23:04:04 +0000 Message-ID: <54B452E4.2040101@draigBrady.com> Date: Mon, 12 Jan 2015 23:04:04 +0000 From: =?UTF-8?Q?P=C3=A1draig?= Brady User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 References: <1421019397.984376339@f387.i.mail.ru> <54B323E7.6000204@draigBrady.com> <54B43C31.6050103@bernhard-voelker.de> In-Reply-To: <54B43C31.6050103@bernhard-voelker.de> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) On 12/01/15 21:27, Bernhard Voelker wrote: > On 01/12/2015 02:31 AM, Pádraig Brady wrote: >> On 11/01/15 23:36, Vladimir A. Pavlov wrote: >>> run /run tmpfs rw,noatime,nodiratime,nodev,noexec,mode=0755,size=1m 0 0 >>> /run/cgs/httpd /usr/cgs/httpd/run none rw,bind 0 0 > >> Thanks for the analysis and patch, >> Current tests pass at least with it. >> I'll analyse a little more, add tests and probably push. > > hmm, tmpfs is problematic anyway, as one can specify anything > as the dummy backing source device: > > $ mount -t tmpfs hello:/world /mnt > $ mount -t tmpfs something /mnt > $ mount -t tmpfs / /mnt > $ findmnt /mnt > TARGET SOURCE FSTYPE OPTIONS > /mnt hello:/world tmpfs rw,relatime > /mnt something tmpfs rw,relatime > /mnt / tmpfs rw,relatime > > $ df -a --out=source,target | grep /mnt > hello:/world /mnt > something /mnt > / /mnt > > I'd almost tend to recommend to classify tmpfs as dummy > file system like procfs etc. I see what you mean. However we take dummy to mean, no associated storage in the memory hierarchy, which tmpfs clearly has. Pádraig From unknown Sun Jun 22 11:42:36 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.503 (Entity 5.503) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Vladimir A. Pavlov Subject: bug#19570: closed (Re: bug#19570: bug: df and bind mounts) Message-ID: References: <558D8BFD.3020505@draigBrady.com> <1421019397.984376339@f387.i.mail.ru> X-Gnu-PR-Message: they-closed 19570 X-Gnu-PR-Package: coreutils Reply-To: 19570@debbugs.gnu.org Date: Fri, 26 Jun 2015 17:30:07 +0000 Content-Type: multipart/mixed; boundary="----------=_1435339807-29703-1" This is a multi-part message in MIME format... ------------=_1435339807-29703-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #19570: bug: df and bind mounts which was filed against the coreutils package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 19570@debbugs.gnu.org. --=20 19570: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D19570 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1435339807-29703-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 19570-done) by debbugs.gnu.org; 26 Jun 2015 17:29:45 +0000 Received: from localhost ([127.0.0.1]:58383 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z8XRh-0007iN-2p for submit@debbugs.gnu.org; Fri, 26 Jun 2015 13:29:45 -0400 Received: from mail2.vodafone.ie ([213.233.128.44]:56534) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z8XRe-0007iA-NI for 19570-done@debbugs.gnu.org; Fri, 26 Jun 2015 13:29:43 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Au4FAPSKjVVtTWCy/2dsb2JhbABbgxEfNV8Bgx27e4VxAQICgT9MAQEBAQEBgQuEIwEBBCMPAVYLDQsCAgUWCwICCQMCAQIBRQYBDAgBARqIFQEIuQiFa5BKLIEhiimCa4FoOoJogUMFjBKHcoRYiDSHEQyPYCaDez0xAQEBAoJDAQEB Received: from unknown (HELO localhost.localdomain) ([109.77.96.178]) by mail2.vodafone.ie with ESMTP; 26 Jun 2015 18:29:33 +0100 Message-ID: <558D8BFD.3020505@draigBrady.com> Date: Fri, 26 Jun 2015 18:29:33 +0100 From: =?UTF-8?B?UMOhZHJhaWcgQnJhZHk=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: "Vladimir A. Pavlov" , 19570-done@debbugs.gnu.org Subject: Re: bug#19570: bug: df and bind mounts References: <1421019397.984376339@f387.i.mail.ru> <54B323E7.6000204@draigBrady.com> In-Reply-To: <54B323E7.6000204@draigBrady.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 19570-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) On 12/01/15 01:31, Pádraig Brady wrote: > On 11/01/15 23:36, Vladimir A. Pavlov wrote: >> Hello, >> >> I have an issue with df (both in version 8.23 and in master branch). >> >> I have tmpfs mounted as /run . There is /run/cgs/httpd subdirectory in >> /run (just a subdirectory, not a tmpfs or another mount). This >> /run/cgs/httpd is bind-mounted to /usr/cgs/httpd/run. >> >> The current algorithm in df.c:filter_mount_list() chooses the bind >> mountpoint since it has the leading slash in the "device" name >> ("/run/cgs/httpd" vs "run") which is wrong in my setup. >> >> The similar (but not the same) issue is fixed by commit: >> http://git.savannah.gnu.org/cgit/coreutils.git/commit/src/df.c?id=ed1a495b3ccb2665a13229ca866f2115bd768d17 >> >> I guess the "let real devices with / in the name win" replacement branch >> should only be applied if mountpoints are the same as well. >> >> Below is the data to reproduce the bug. >> >> === /etc/mtab (partial) === >> run /run tmpfs rw,noatime,nodiratime,nodev,noexec,mode=0755,size=1m 0 0 >> /run/cgs/httpd /usr/cgs/httpd/run none rw,bind 0 0 >> ====== >> >> === Real output (git) === >> Filesystem Size Used Avail Use% Mounted on >> /run/cgs/httpd 1.0M 8.0K 1016K 1% /usr/cgs/httpd/run >> ====== >> >> === Expected output (with the attached patch applied) === >> Filesystem Size Used Avail Use% Mounted on >> run 1.0M 8.0K 1016K 1% /run >> ====== >> > > Thanks for the analysis and patch, > Current tests pass at least with it. > I'll analyse a little more, add tests and probably push. df v8.24 will read /proc/self/mountinfo if available and so won't hit this issue in practise as the bind mount location won't be passed to, or presented by df. I.E. the "Filesystem" for a particular device id will not switch representations. thanks, Pádraig. ------------=_1435339807-29703-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 11 Jan 2015 23:53:17 +0000 Received: from localhost ([127.0.0.1]:42967 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YASJn-0002v7-6D for submit@debbugs.gnu.org; Sun, 11 Jan 2015 18:53:16 -0500 Received: from eggs.gnu.org ([208.118.235.92]:57496) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YAS3q-0002G5-6G for submit@debbugs.gnu.org; Sun, 11 Jan 2015 18:36:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YAS3o-0002AR-Uh for submit@debbugs.gnu.org; Sun, 11 Jan 2015 18:36:46 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: * X-Spam-Status: No, score=1.8 required=5.0 tests=BAYES_50,FROM_EXCESS_BASE64, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:43543) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YAS3o-0002AN-Rv for submit@debbugs.gnu.org; Sun, 11 Jan 2015 18:36:44 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59211) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YAS3n-0001fC-Qj for bug-coreutils@gnu.org; Sun, 11 Jan 2015 18:36:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YAS3k-00029m-Fb for bug-coreutils@gnu.org; Sun, 11 Jan 2015 18:36:43 -0500 Received: from f387.i.mail.ru ([185.5.136.58]:43763) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YAS3j-00029L-W4 for bug-coreutils@gnu.org; Sun, 11 Jan 2015 18:36:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=bk.ru; s=mail; h=Content-Type:Message-ID:Reply-To:Date:MIME-Version:Subject:To:From; bh=VvkD1OdMZVbwKQLBN1bnJeix0ER2pFgqFKwFfQQuYdI=; b=Hs//jiLwegJSKSVSYGoCi5NHDv/y7VMupT1QUoUhN1cHqTuV29jVk3v4f3BZ7n5H0SPlsJdU0c8KQHgAn7xAAa4gMau97uQuoZOjFvZMHXDNrZB+LBGtDm0HM3kXbZCxWQoxoMPQBHx7FMYZFo2j5wMg+Mkjo7su/K/6bEPDodk=; Received: from [128.75.172.33] (ident=mail) by f387.i.mail.ru with local (envelope-from ) id 1YAS3h-0004ub-B1 for bug-coreutils@gnu.org; Mon, 12 Jan 2015 02:36:38 +0300 Received: from [128.75.172.33] by e.mail.ru with HTTP; Mon, 12 Jan 2015 02:36:37 +0300 From: =?UTF-8?B?VmxhZGltaXIgQS4gUGF2bG92?= To: bug-coreutils@gnu.org Subject: =?UTF-8?B?YnVnOiBkZiBhbmQgYmluZCBtb3VudHM=?= MIME-Version: 1.0 X-Mailer: Mail.Ru Mailer 1.0 X-Originating-IP: [128.75.172.33] Date: Mon, 12 Jan 2015 02:36:37 +0300 X-Priority: 3 (Normal) Message-ID: <1421019397.984376339@f387.i.mail.ru> Content-Type: multipart/mixed; boundary="----XbyFP4rp66ey0lKGrt6tcKFQfSP53gWh-anAA5WAW0kKpitkx:1421019397" X-Mras: Ok X-Spam: undefined X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -3.9 (---) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Sun, 11 Jan 2015 18:53:13 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: =?UTF-8?B?VmxhZGltaXIgQS4gUGF2bG92?= List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.9 (---) ------XbyFP4rp66ey0lKGrt6tcKFQfSP53gWh-anAA5WAW0kKpitkx:1421019397 Content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dGhlIGRhdGEgdG8gcmVwcm9kdWNlIHRoZSBidWcuCgo9PT0g L2V0Yy9tdGFiIChwYXJ0aWFsKSA9PT0KcnVuIC9ydW4gdG1wZnMgcncsbm9hdGltZSxub2RpcmF0 aW1lLG5vZGV2LG5vZXhlYyxtb2RlPTA3NTUsc2l6ZT0xbSAwIDAKL3J1bi9jZ3MvaHR0cGQgL3Vz ci9jZ3MvaHR0cGQvcnVuIG5vbmUgcncsYmluZCAwIDAKPT09PT09Cgo9PT0gUmVhbCBvdXRwdXQg KGdpdCkgPT09CkZpbGVzeXN0ZW0gICAgICBTaXplICBVc2VkIEF2YWlsIFVzZSUgTW91bnRlZCBv bgovcnVuL2Nncy9odHRwZCAgMS4wTSAgOC4wSyAxMDE2SyAgIDElIC91c3IvY2dzL2h0dHBkL3J1 bgo9PT09PT0KCj09PSBFeHBlY3RlZCBvdXRwdXQgKHdpdGggdGhlIGF0dGFjaGVkIHBhdGNoIGFw cGxpZWQpID09PQpGaWxlc3lzdGVtICAgICAgU2l6ZSAgVXNlZCBBdmFpbCBVc2UlIE1vdW50ZWQg b24KcnVuICAgICAgICAgICAgIDEuME0gIDguMEsgMTAxNksgICAxJSAvcnVuCj09PT09PQoKLS0g ClZsYWRpbWlyIEEuIFBhdmxvdg== ------XbyFP4rp66ey0lKGrt6tcKFQfSP53gWh-anAA5WAW0kKpitkx:1421019397 Content-Type: application/x-patch; name="=?UTF-8?B?Y29yZXV0aWxzLTguMjMtZGZfYmluZG1vdW50X2ZpeC5wYXRjaA==?=" Content-Disposition: attachment Content-Transfer-Encoding: base64 LS0tIGNvcmV1dGlscy1naXQub3JpZy9zcmMvZGYuYwkyMDE1LTAxLTEyIDAxOjQ2OjQ4LjAwMDAw MDAwMCArMDMwMAorKysgY29yZXV0aWxzLWdpdC9zcmMvZGYuYwkyMDE1LTAxLTEyIDAyOjA4OjEx LjE5MDAxMjIwNyArMDMwMApAQCAtNjUwLDcgKzY1MCw4IEBAIGZpbHRlcl9tb3VudF9saXN0IChi b29sIGRldmljZXNfb25seSkKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgIGVsc2Ug aWYgKChzdHJjaHIgKG1lLT5tZV9kZXZuYW1lLCAnLycpCiAgICAgICAgICAgICAgICAgICAgICAg IC8qIGxldCAicmVhbCIgZGV2aWNlcyB3aXRoICcvJyBpbiB0aGUgbmFtZSB3aW4uICAqLwotICAg ICAgICAgICAgICAgICAgICAgICAgJiYgISBzdHJjaHIgKGRldmxpc3QtPm1lLT5tZV9kZXZuYW1l LCAnLycpKQorICAgICAgICAgICAgICAgICAgICAgICAgJiYgISBzdHJjaHIgKGRldmxpc3QtPm1l LT5tZV9kZXZuYW1lLCAnLycpCisgICAgICAgICAgICAgICAgICAgICAgICAmJiBTVFJFUSAobWUt Pm1lX21vdW50ZGlyLCBkZXZsaXN0LT5tZS0+bWVfbW91bnRkaXIpKQogICAgICAgICAgICAgICAg ICAgICAgICAvKiBsZXQgYSBzaG9ydGVyIG1vdW50ZGlyIHdpbi4gICovCiAgICAgICAgICAgICAg ICAgICAgICAgIHx8IChzdHJsZW4gKGRldmxpc3QtPm1lLT5tZV9tb3VudGRpcikKICAgICAgICAg ICAgICAgICAgICAgICAgICAgID4gc3RybGVuIChtZS0+bWVfbW91bnRkaXIpKQo= ------XbyFP4rp66ey0lKGrt6tcKFQfSP53gWh-anAA5WAW0kKpitkx:1421019397-- ------------=_1435339807-29703-1--