From unknown Wed Sep 10 12:53:42 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#10282 <10282@debbugs.gnu.org> To: bug#10282 <10282@debbugs.gnu.org> Subject: Status: du: hard-links counting with multiple arguments (commit Reply-To: bug#10282 <10282@debbugs.gnu.org> Date: Wed, 10 Sep 2025 19:53:42 +0000 retitle 10282 du: hard-links counting with multiple arguments (commit reassign 10282 coreutils submitter 10282 Kamil Dudka severity 10282 wishlist tag 10282 wontfix thanks From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 12 15:04:40 2011 Received: (at submit) by debbugs.gnu.org; 12 Dec 2011 20:04:40 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RaC73-0002OB-Uh for submit@debbugs.gnu.org; Mon, 12 Dec 2011 15:04:40 -0500 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ra5Mj-0000gC-LJ for submit@debbugs.gnu.org; Mon, 12 Dec 2011 07:52:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ra5LY-0004Bx-PO for submit@debbugs.gnu.org; Mon, 12 Dec 2011 07:51:09 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-9.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([140.186.70.17]:50335) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ra5LY-0004Bt-My for submit@debbugs.gnu.org; Mon, 12 Dec 2011 07:51:08 -0500 Received: from eggs.gnu.org ([140.186.70.92]:50876) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ra5LX-0001AS-Mk for bug-coreutils@gnu.org; Mon, 12 Dec 2011 07:51:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ra5LW-0004Bc-E3 for bug-coreutils@gnu.org; Mon, 12 Dec 2011 07:51:07 -0500 Received: from mx1.redhat.com ([209.132.183.28]:15272) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ra5LW-0004BX-7U for bug-coreutils@gnu.org; Mon, 12 Dec 2011 07:51:06 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id pBCCovgb025365 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 12 Dec 2011 07:50:57 -0500 Received: from kdudka.brq.redhat.com (kdudka.brq.redhat.com [10.34.24.8]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id pBCCovAa001037; Mon, 12 Dec 2011 07:50:57 -0500 From: Kamil Dudka To: bug-coreutils@gnu.org Subject: change in behavior of du with multiple arguments (commit efe53cc) Date: Mon, 12 Dec 2011 13:50:30 +0100 User-Agent: KMail/1.12.4 (Linux/2.6.32-220.el6.x86_64; KDE/4.3.4; x86_64; ; ) MIME-Version: 1.0 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-Id: <201112121350.30539.kdudka@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.17 X-Spam-Score: -5.9 (-----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Mon, 12 Dec 2011 15:04:37 -0500 Cc: Paul Eggert X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.9 (-----) Hi, the following upstream commit introduces a major change in behavior of du when multiple arguments are specified: http://git.savannah.gnu.org/cgit/coreutils.git/commit/?id=efe53cc ... and the issue has landed as a bug in our Bugzilla: https://bugzilla.redhat.com/747075#c3 Was such a change in behavior intended? I am asking as I was not able to find it documented anywhere. The up2date man page states: Summarize disk usage of each FILE, recursively for directories. ..., where FILE refers to a single argument given to du. The info documentation states: The FILE argument order affects which links are counted, and changing the argument order may change the numbers that `du' outputs. However, changing the numbers is one thing and missing lines in the output of du is quite another thing. Could anybody please clarify the current behavior of du? Thanks in advance! Kamil From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 12 17:35:20 2011 Received: (at 10282) by debbugs.gnu.org; 12 Dec 2011 22:35:20 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RaESu-0005ua-BA for submit@debbugs.gnu.org; Mon, 12 Dec 2011 17:35:20 -0500 Received: from mx1.redhat.com ([209.132.183.28]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RaESr-0005uS-9y for 10282@debbugs.gnu.org; Mon, 12 Dec 2011 17:35:19 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id pBCMY1al024177 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 12 Dec 2011 17:34:01 -0500 Received: from [10.3.113.112] (ovpn-113-112.phx2.redhat.com [10.3.113.112]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id pBCMY03g021791; Mon, 12 Dec 2011 17:34:00 -0500 Message-ID: <4EE68157.2020006@redhat.com> Date: Mon, 12 Dec 2011 15:33:59 -0700 From: Eric Blake Organization: Red Hat User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20111115 Thunderbird/8.0 MIME-Version: 1.0 To: Kamil Dudka Subject: Re: bug#10282: change in behavior of du with multiple arguments (commit efe53cc) References: <201112121350.30539.kdudka@redhat.com> In-Reply-To: <201112121350.30539.kdudka@redhat.com> X-Enigmail-Version: 1.3.4 OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enig081E4F63A347A573424D3BC9" X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Spam-Score: -10.3 (----------) X-Debbugs-Envelope-To: 10282 Cc: Paul Eggert , 10282@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -10.3 (----------) This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig081E4F63A347A573424D3BC9 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 12/12/2011 05:50 AM, Kamil Dudka wrote: > Hi, >=20 > the following upstream commit introduces a major change in behavior of = du > when multiple arguments are specified: >=20 > http://git.savannah.gnu.org/cgit/coreutils.git/commit/?id=3Defe53cc >=20 > ... and the issue has landed as a bug in our Bugzilla: >=20 > https://bugzilla.redhat.com/747075#c3 >=20 > Was such a change in behavior intended? A change in behavior was intended, but I think we ended up introducing a bug in its place. > The info=20 > documentation states: >=20 > The FILE argument order affects which links are counted, and changi= ng the > argument order may change the numbers that `du' outputs. And this is intended. The end goal is that if a directory appears both on the command line and as a child of another directory on the command line, that it gets counted only once. >=20 > However, changing the numbers is one thing and missing lines in the out= put > of du is quite another thing. Yes, that's the bug I think we introduced - we are mistakenly eliding lines of output, rather than listing those directories with 0 attributed additional size. More importantly, POSIX says of -s: "=E2=88=92s Instead of the default output, report only the total sum for = each of the specified files." But we fail that: $ mkdir -p /tmp/a/b $ cd /tmp/a $ du -s . b 8 . $ du -s b . 4 b 4 . We correctly deduced that only 8 units were occupied (that is, b was not double-counted in either approach), but we _failed_ to list b in the first approach. I think POSIX requires the output to have been: $ du -s . b 8 . 0 b as an indication that we did visit b, but that there were no additional contributions to the disk usage encountered during our visit there. Meanwhile, without -s, I still think we elided too much data: $ du . b 4 ./b 8 . $ du b . 4 b 4 . In the first case, we recursed into ./b, then back out to ., but elided any notion that we ever directly visited b. In the second case, we visited b, then recursed into ./b but had nothing to output, then back out to '.'. I think that a saner output would be: $ du . b 4 ./b 8 . 0 b $ du b . 4 b 0 ./b 4 . to make it obvious that we pruned recursion at points where we encountered duplicates, and that the sum of the first columns shows an accurate disk usage. --=20 Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --------------enig081E4F63A347A573424D3BC9 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBCAAGBQJO5oFXAAoJEKeha0olJ0Nq50wH/ixxoOWbp5GtbbABoMlSb2cD 6MxX9Ceb6DdRLrsQ91ZOvMqNjPpJd8BqYAj90IOHJf0CTfPTjM2NuFvC6G/PJSYG 2nb938GB8BysxlbmywWuGKNwrx2QXprsmbB0ZfS7FePwzNbz8piXFdbhcJdBzOlB OLPSKItWPF5Vh74BGoLzF/36pgyK9WUopgwG8WpG2HUrK+zCaGvbpcK0RoYAVKmC tNlLK6M2hISl3cL3kjWkTLY8qaXXi59VmaZZWvPOQdoXGXa4A1RfMtZTfAigbNd7 qni+sOigvx+mqZEAbK2D0LaHBvhnOresykyvnH4ZDe36E2lzlAty4EOBTZRS1qo= =rT1E -----END PGP SIGNATURE----- --------------enig081E4F63A347A573424D3BC9-- From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 12 17:59:54 2011 Received: (at 10282) by debbugs.gnu.org; 12 Dec 2011 22:59:54 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RaEqg-0006SL-Bo for submit@debbugs.gnu.org; Mon, 12 Dec 2011 17:59:54 -0500 Received: from mx1.redhat.com ([209.132.183.28]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RaEqc-0006SA-Mu for 10282@debbugs.gnu.org; Mon, 12 Dec 2011 17:59:52 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id pBCMwZW3005214 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 12 Dec 2011 17:58:35 -0500 Received: from [10.3.113.112] (ovpn-113-112.phx2.redhat.com [10.3.113.112]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id pBCMwY6b029760; Mon, 12 Dec 2011 17:58:34 -0500 Message-ID: <4EE6871A.9030609@redhat.com> Date: Mon, 12 Dec 2011 15:58:34 -0700 From: Eric Blake Organization: Red Hat User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20111115 Thunderbird/8.0 MIME-Version: 1.0 Subject: Re: bug#10282: change in behavior of du with multiple arguments (commit efe53cc) References: <201112121350.30539.kdudka@redhat.com> <4EE68157.2020006@redhat.com> In-Reply-To: <4EE68157.2020006@redhat.com> X-Enigmail-Version: 1.3.4 OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enig1578A66B9484AEE82F9ED844" X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Spam-Score: -9.7 (---------) X-Debbugs-Envelope-To: 10282 Cc: Kamil Dudka , Paul Eggert , 10282@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -9.7 (---------) This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig1578A66B9484AEE82F9ED844 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 12/12/2011 03:33 PM, Eric Blake wrote: >> However, changing the numbers is one thing and missing lines in the ou= tput >> of du is quite another thing. >=20 > Yes, that's the bug I think we introduced - we are mistakenly eliding > lines of output, rather than listing those directories with 0 attribute= d > additional size. >=20 > More importantly, POSIX says of -s: >=20 > "=E2=88=92s Instead of the default output, report only the total sum fo= r each of > the specified files." >=20 > But we fail that: >=20 > $ mkdir -p /tmp/a/b > $ cd /tmp/a > $ du -s . b > 8 . > $ du -s b . > 4 b > 4 . >=20 > We correctly deduced that only 8 units were occupied (that is, b was no= t > double-counted in either approach), but we _failed_ to list b in the > first approach. I think POSIX requires the output to have been: >=20 > $ du -s . b > 8 . > 0 b POSIX also says: "Files with multiple links shall be counted and written for only one entry. The directory entry that is selected in the report is unspecified.= " But even historically, command line arguments were always listed, even if they are otherwise multiple links. On Solaris 10, for example, $ touch a $ ln a b $ /bin/du a b 1 a 1 b instead of omitting one of the two entries. The omission only occurs during recursion of a directory on the command line: $ /bin/du -a . 1 ./b 4 . > I think that a saner output would be: >=20 > $ du . b > 4 ./b > 8 . > 0 b So this would be okay (even though we encountered b via two different links, the second encounter was a command line, so it should not be elided entirely, but listing 0 would make it obvious that there is no further disk usage to count), > $ du b . > 4 b > 0 ./b > 4 . whereas this proposed line of '0 ./b' is questionable (we could argue that ./b should not be elided because no other link to b was printed during recursion, or we could argue that elision should trump recursion once the command line arguments have been printed). --=20 Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --------------enig1578A66B9484AEE82F9ED844 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBCAAGBQJO5ocaAAoJEKeha0olJ0NqOWAIAJ6zfJYfZSNf0TJh0qtrIW2E XaV2hMCWKctpwOWbTJYkcN7IFbCl/rCZEJODIIj2xHkQ41X97T7+CKOggrtGpKA7 BYya1jfr4Jlh4njJX1EQ/vJ37qopqBqHjZn53KBnrjKjKumtddb1BSiP+f4DXuDC gakvxPQW2Cu7G52Sw+xw5cHcCkWKUicSjWiaSRSc6XrKq5O3PNKYyktzEEy6Vxa3 SKhyRMb2ptyDS2/rPW3ewjj3BmegEdx+2UAV751wGFVH4GenhPdAjubFLv4J3Vxz TMnFvPuih+Gq0FCB451+TUc0dx29VVchBftnrIe+jL2M2ChXneglBLADV4aas6Q= =mTta -----END PGP SIGNATURE----- --------------enig1578A66B9484AEE82F9ED844-- From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 12 19:26:03 2011 Received: (at control) by debbugs.gnu.org; 13 Dec 2011 00:26:03 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RaGC2-0008PC-2x for submit@debbugs.gnu.org; Mon, 12 Dec 2011 19:26:02 -0500 Received: from smtp.cs.ucla.edu ([131.179.128.62]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RaGBz-0008On-Jt for control@debbugs.gnu.org; Mon, 12 Dec 2011 19:26:00 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id AB2D839E800A for ; Mon, 12 Dec 2011 16:24:43 -0800 (PST) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Ohhg6S0F-2nx for ; Mon, 12 Dec 2011 16:24:43 -0800 (PST) Received: from penguin.cs.ucla.edu (Penguin.CS.UCLA.EDU [131.179.64.200]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 5C85C39E8008 for ; Mon, 12 Dec 2011 16:24:43 -0800 (PST) Message-ID: <4EE69B4B.9060405@cs.ucla.edu> Date: Mon, 12 Dec 2011 16:24:43 -0800 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20111115 Thunderbird/8.0 MIME-Version: 1.0 To: control@debbugs.gnu.org Subject: bugs 10281 and 10282 are duplicates Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: -3.0 (---) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.0 (---) forcemerge 10282 10281 thanks Somehow bug#10282 was delayed, and my reply to it started bug#10281. I'm merging the two now. From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 12 19:46:44 2011 Received: (at 10282) by debbugs.gnu.org; 13 Dec 2011 00:46:44 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RaGW3-0001Aa-KQ for submit@debbugs.gnu.org; Mon, 12 Dec 2011 19:46:44 -0500 Received: from smtp.cs.ucla.edu ([131.179.128.62]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RaGVz-0001AP-7G for 10282@debbugs.gnu.org; Mon, 12 Dec 2011 19:46:40 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 0BDD039E8008; Mon, 12 Dec 2011 16:45:23 -0800 (PST) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gTVGCSvBIppw; Mon, 12 Dec 2011 16:45:22 -0800 (PST) Received: from penguin.cs.ucla.edu (Penguin.CS.UCLA.EDU [131.179.64.200]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 547A239E8006; Mon, 12 Dec 2011 16:45:22 -0800 (PST) Message-ID: <4EE6A022.8060604@cs.ucla.edu> Date: Mon, 12 Dec 2011 16:45:22 -0800 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20111115 Thunderbird/8.0 MIME-Version: 1.0 To: Eric Blake Subject: Re: bug#10282: change in behavior of du with multiple arguments (commit efe53cc) References: <201112121350.30539.kdudka@redhat.com> <4EE68157.2020006@redhat.com> <4EE6871A.9030609@redhat.com> In-Reply-To: <4EE6871A.9030609@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: -3.0 (---) X-Debbugs-Envelope-To: 10282 Cc: Kamil Dudka , 10282@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.0 (---) On 12/12/11 14:58, Eric Blake wrote: > "Files with multiple links shall be counted and written for only one > entry. The directory entry that is selected in the report is unspecified." Yes, that's partly what motivates the current GNU du behavior: the idea is to implement this notion consistently (historical 'du' implementations do not). > But even historically, command line arguments were always listed, even > if they are otherwise multiple links. I suppose we could change GNU 'du' to output "0 X" for a command-line argument X that's already been seen. This wouldn't address the problem perceived by the original poster, though. And it's a glitch from the point of view of consistency. Perhaps 'du' needs a new option to control what to do with files that 'du' has already seen before. something that generalizes --count-links. From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 13 02:10:29 2011 Received: (at 10282) by debbugs.gnu.org; 13 Dec 2011 07:10:29 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RaMVQ-0001Tg-C0 for submit@debbugs.gnu.org; Tue, 13 Dec 2011 02:10:29 -0500 Received: from mx.meyering.net ([88.168.87.75]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RaMVN-0001TX-Qy for 10282@debbugs.gnu.org; Tue, 13 Dec 2011 02:10:26 -0500 Received: from rho.meyering.net (localhost.localdomain [127.0.0.1]) by rho.meyering.net (Acme Bit-Twister) with ESMTP id 8A40C60039; Tue, 13 Dec 2011 08:09:08 +0100 (CET) From: Jim Meyering To: Paul Eggert Subject: Re: bug#10282: change in behavior of du with multiple arguments (commit efe53cc) In-Reply-To: <4EE6A022.8060604@cs.ucla.edu> (Paul Eggert's message of "Mon, 12 Dec 2011 16:45:22 -0800") References: <201112121350.30539.kdudka@redhat.com> <4EE68157.2020006@redhat.com> <4EE6871A.9030609@redhat.com> <4EE6A022.8060604@cs.ucla.edu> Date: Tue, 13 Dec 2011 08:09:08 +0100 Message-ID: <87ehw9t0bv.fsf@rho.meyering.net> Lines: 34 MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.7 (--) X-Debbugs-Envelope-To: 10282 Cc: Kamil Dudka , Eric Blake , 10282@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.7 (--) Paul Eggert wrote: > On 12/12/11 14:58, Eric Blake wrote: >> "Files with multiple links shall be counted and written for only one >> entry. The directory entry that is selected in the report is unspecified." > > Yes, that's partly what motivates the current GNU du behavior: > the idea is to implement this notion consistently (historical > 'du' implementations do not). > >> But even historically, command line arguments were always listed, even >> if they are otherwise multiple links. > > I suppose we could change GNU 'du' to output "0 X" for a command-line > argument X that's already been seen. This seems sensible. > This wouldn't address the problem > perceived by the original poster, though. And it's a glitch from the > point of view of consistency. I agree that printing "0 X" for these seems inconsistent with the elision mandated for the second and subsequent encounter of a file, but I suppose command line arguments are intrinsically different enough that handling them specially makes sense. Maybe even as the default. > Perhaps 'du' needs a new option to control what to do with > files that 'du' has already seen before. something that > generalizes --count-links. That sounds like a good way to do it. Anyone interested? From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 13 12:01:45 2011 Received: (at 10282) by debbugs.gnu.org; 13 Dec 2011 17:01:45 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RaVja-0008Kp-Pb for submit@debbugs.gnu.org; Tue, 13 Dec 2011 12:01:43 -0500 Received: from mx1.redhat.com ([209.132.183.28]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RaVjW-0008Kg-Ho for 10282@debbugs.gnu.org; Tue, 13 Dec 2011 12:01:40 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id pBDH0BPh024330 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 13 Dec 2011 12:00:12 -0500 Received: from kdudka.brq.redhat.com (kdudka.brq.redhat.com [10.34.24.8]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id pBDH0B6U022319; Tue, 13 Dec 2011 12:00:11 -0500 From: Kamil Dudka To: Jim Meyering Subject: Re: bug#10282: change in behavior of du with multiple arguments (commit efe53cc) Date: Tue, 13 Dec 2011 17:46:05 +0100 User-Agent: KMail/1.12.4 (Linux/2.6.32-220.el6.x86_64; KDE/4.3.4; x86_64; ; ) References: <201112121350.30539.kdudka@redhat.com> <4EE6A022.8060604@cs.ucla.edu> <87ehw9t0bv.fsf@rho.meyering.net> In-Reply-To: <87ehw9t0bv.fsf@rho.meyering.net> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-6" Content-Transfer-Encoding: 7bit Message-Id: <201112131746.06025.kdudka@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Spam-Score: -8.3 (--------) X-Debbugs-Envelope-To: 10282 Cc: Paul Eggert , Eric Blake , 10282@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -9.0 (---------) On Tuesday 13 December 2011 08:09:08 Jim Meyering wrote: > Paul Eggert wrote: > > On 12/12/11 14:58, Eric Blake wrote: > >> "Files with multiple links shall be counted and written for only one > >> entry. The directory entry that is selected in the report is > >> unspecified." > > > > Yes, that's partly what motivates the current GNU du behavior: > > the idea is to implement this notion consistently (historical > > 'du' implementations do not). > > > >> But even historically, command line arguments were always listed, even > >> if they are otherwise multiple links. > > > > I suppose we could change GNU 'du' to output "0 X" for a command-line > > argument X that's already been seen. > > This seems sensible. > > > This wouldn't address the problem > > perceived by the original poster, though. And it's a glitch from the > > point of view of consistency. > > I agree that printing "0 X" for these seems inconsistent with the > elision mandated for the second and subsequent encounter of a file, > but I suppose command line arguments are intrinsically different > enough that handling them specially makes sense. Maybe even as > the default. > > > Perhaps 'du' needs a new option to control what to do with > > files that 'du' has already seen before. something that > > generalizes --count-links. > > That sounds like a good way to do it. > Anyone interested? Thank all of you for looking at the issue. If I understand it correctly, the old behavior was violating POSIX whereas the current default behavior is correct. I tried du --count-links with the original reproducer and it seemed to work fine. So what would be the point in adding a new option? Kamil From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 13 12:12:56 2011 Received: (at 10282) by debbugs.gnu.org; 13 Dec 2011 17:12:56 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RaVuR-00008w-Vk for submit@debbugs.gnu.org; Tue, 13 Dec 2011 12:12:56 -0500 Received: from smtp.cs.ucla.edu ([131.179.128.62]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RaVuP-00008n-09 for 10282@debbugs.gnu.org; Tue, 13 Dec 2011 12:12:54 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 9360339E800B; Tue, 13 Dec 2011 09:11:33 -0800 (PST) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Audi9DlGtBrl; Tue, 13 Dec 2011 09:11:33 -0800 (PST) Received: from [192.168.1.10] (pool-71-189-109-235.lsanca.fios.verizon.net [71.189.109.235]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 3489339E800A; Tue, 13 Dec 2011 09:11:33 -0800 (PST) Message-ID: <4EE78744.2030200@cs.ucla.edu> Date: Tue, 13 Dec 2011 09:11:32 -0800 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; Linux i686; rv:8.0) Gecko/20111124 Thunderbird/8.0 MIME-Version: 1.0 To: Kamil Dudka Subject: Re: bug#10282: change in behavior of du with multiple arguments (commit efe53cc) References: <201112121350.30539.kdudka@redhat.com> <4EE6A022.8060604@cs.ucla.edu> <87ehw9t0bv.fsf@rho.meyering.net> <201112131746.06025.kdudka@redhat.com> In-Reply-To: <201112131746.06025.kdudka@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: -2.9 (--) X-Debbugs-Envelope-To: 10282 Cc: Eric Blake , Jim Meyering , 10282@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.9 (--) On 12/13/11 08:46, Kamil Dudka wrote: > If I understand it correctly, the > old behavior was violating POSIX whereas the current default behavior is > correct. I tried du --count-links with the original reproducer and it seemed > to work fine. So what would be the point in adding a new option? Hey, I like that answer! Less work. Though arguably POSIX is incorrect here, as it seems to prohibit common behavior in most other 'du's. From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 13 12:17:39 2011 Received: (at 10282) by debbugs.gnu.org; 13 Dec 2011 17:17:39 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RaVz0-0000G1-1B for submit@debbugs.gnu.org; Tue, 13 Dec 2011 12:17:38 -0500 Received: from mx1.redhat.com ([209.132.183.28]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RaVyw-0000Ft-9G for 10282@debbugs.gnu.org; Tue, 13 Dec 2011 12:17:36 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id pBDHGE2N019726 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 13 Dec 2011 12:16:14 -0500 Received: from [10.3.113.112] (ovpn-113-112.phx2.redhat.com [10.3.113.112]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id pBDHGDMq009314; Tue, 13 Dec 2011 12:16:13 -0500 Message-ID: <4EE7885C.4080506@redhat.com> Date: Tue, 13 Dec 2011 10:16:12 -0700 From: Eric Blake Organization: Red Hat User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20111115 Thunderbird/8.0 MIME-Version: 1.0 To: Kamil Dudka Subject: Re: bug#10282: change in behavior of du with multiple arguments (commit efe53cc) References: <201112121350.30539.kdudka@redhat.com> <4EE6A022.8060604@cs.ucla.edu> <87ehw9t0bv.fsf@rho.meyering.net> <201112131746.06025.kdudka@redhat.com> In-Reply-To: <201112131746.06025.kdudka@redhat.com> X-Enigmail-Version: 1.3.4 OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enig8A33EB4AD11858F37FDBD3E5" X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Spam-Score: -10.3 (----------) X-Debbugs-Envelope-To: 10282 Cc: Paul Eggert , Jim Meyering , 10282@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -10.3 (----------) This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig8A33EB4AD11858F37FDBD3E5 Content-Type: text/plain; charset=ISO-8859-6 Content-Transfer-Encoding: quoted-printable On 12/13/2011 09:46 AM, Kamil Dudka wrote: >> I agree that printing "0 X" for these seems inconsistent with the >> elision mandated for the second and subsequent encounter of a file, >> but I suppose command line arguments are intrinsically different >> enough that handling them specially makes sense. Maybe even as >> the default. >> >>> Perhaps 'du' needs a new option to control what to do with >>> files that 'du' has already seen before. something that >>> generalizes --count-links. >> >> That sounds like a good way to do it. >> Anyone interested? >=20 > Thank all of you for looking at the issue. If I understand it correctl= y, the=20 > old behavior was violating POSIX whereas the current default behavior i= s=20 > correct. Not quite. The POSIX wording does not match historical practice, and appears to be contradictory (or at least ambiguous), so we may need to ask for clarification from the Austin Group. The problem is that POSIX says that if an inode is encountered more than once, it is only listed once (without reference to whether those encounters were from recursion on a single command line argument, recursion across multiple command line arguments, or even if the duplication occurs on the command line itself); but it also says that with '-s', listings are output for all command line arguments. Historically, du implementations elided output for inode duplication found within a single command line argument, but not across multiple command line arguments. The coreutils behavior was changed to elide duplicates across multiple command line arguments; particularly so that in the -s case, you can sum the total usage and get an accurate feel, no matter which order the command line arguments were listed in. But in doing so, we elided duplicate command line arguments, which goes against the POSIX wording that -s will list a summary for all arguments. Hence our proposal of using '0' for a directory previously counted. > I tried du --count-links with the original reproducer and it seemed=20 > to work fine. So what would be the point in adding a new option? I think the proposal is to add a new option that forces du to reset its duplicate inode hash table for each command line argument, to make behavior more like traditional du, even though it means -s can then output a larger usage by summing the first column than what you would get by the default behavior, when encountering command line arguments that are a duplicate with an inode already traversed earlier in the command line. --count-links isn't quite right, because you still want to elide links within a single directory of the command-line argument. Or maybe --count-links gains an optional argument, that says how to count links: --count-links=3Dnone -> POSIX behavior (if POSIX requires elision across command line arguments --count-links=3Dper-directory -> traditional behavior, resetting hash between command line arguments --count-links =3D=3D --count-links=3Dall -> count every file on every enc= ounter --=20 Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --------------enig8A33EB4AD11858F37FDBD3E5 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBCAAGBQJO54hcAAoJEKeha0olJ0NqV8gH/AhRzrUJkFAcDoibmjktcUuM QDWIYQdeASTHlr2qPxTELWpdW4q5KTu+oNe17XUwP531Ag4AIlMqhgpxQALpPX7i QNErvdY+xCg6hN1zqpkmU07Llac3sGbY+nJgSROdtipS8wqaMY9hyynXlt4BvAPW wtfQcIvw1akFQeSkwJkgzIT+mkk+chBH4CnURzxOK6VGUZ3rif0yJqS2tnA8JE6L ghCtaU+ACq6rWouXSweOICoY4IFhOvFeGxkX09L6xzVvK4nVR6K/4ZgcbwGuhG0h cLd6LfcQsFzP7eeeZeKMUpVfe1vNWqX588NbUzto9Sz6V/zV9JtIMXejVnW7cEs= =GOe9 -----END PGP SIGNATURE----- --------------enig8A33EB4AD11858F37FDBD3E5-- From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 13 12:52:48 2011 Received: (at 10282) by debbugs.gnu.org; 13 Dec 2011 17:52:49 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RaWX1-00017i-Rl for submit@debbugs.gnu.org; Tue, 13 Dec 2011 12:52:48 -0500 Received: from mx1.redhat.com ([209.132.183.28]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RaWWz-00017a-I4 for 10282@debbugs.gnu.org; Tue, 13 Dec 2011 12:52:47 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id pBDHpO4s001381 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 13 Dec 2011 12:51:25 -0500 Received: from kdudka.brq.redhat.com (kdudka.brq.redhat.com [10.34.24.8]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id pBDHpOg8005877; Tue, 13 Dec 2011 12:51:24 -0500 From: Kamil Dudka To: Eric Blake Subject: Re: bug#10282: change in behavior of du with multiple arguments (commit efe53cc) Date: Tue, 13 Dec 2011 18:37:18 +0100 User-Agent: KMail/1.12.4 (Linux/2.6.32-220.el6.x86_64; KDE/4.3.4; x86_64; ; ) References: <201112121350.30539.kdudka@redhat.com> <201112131746.06025.kdudka@redhat.com> <4EE7885C.4080506@redhat.com> In-Reply-To: <4EE7885C.4080506@redhat.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-6" Content-Transfer-Encoding: 7bit Message-Id: <201112131837.19023.kdudka@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-Spam-Score: -9.4 (---------) X-Debbugs-Envelope-To: 10282 Cc: Paul Eggert , bug-coreutils@gnu.org, Jim Meyering , 10282@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -9.7 (---------) On Tuesday 13 December 2011 18:16:12 Eric Blake wrote: > I think the proposal is to add a new option that forces du to reset its > duplicate inode hash table for each command line argument, to make > behavior more like traditional du, even though it means -s can then > output a larger usage by summing the first column than what you would > get by the default behavior, when encountering command line arguments > that are a duplicate with an inode already traversed earlier in the > command line. --count-links isn't quite right, because you still want > to elide links within a single directory of the command-line argument. > Or maybe --count-links gains an optional argument, that says how to > count links: > > --count-links=none -> POSIX behavior (if POSIX requires elision across > command line arguments > --count-links=per-directory -> traditional behavior, resetting hash > between command line arguments > --count-links == --count-links=all -> count every file on every encounter What would be the difference between the 'per-directory' variant and invoking du multiple times, giving it one argument at a time? Kamil From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 13 13:05:36 2011 Received: (at submit) by debbugs.gnu.org; 13 Dec 2011 18:05:36 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RaWjP-0001R1-Lq for submit@debbugs.gnu.org; Tue, 13 Dec 2011 13:05:36 -0500 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RaWjM-0001Qs-7n for submit@debbugs.gnu.org; Tue, 13 Dec 2011 13:05:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RaWhz-0007w3-F4 for submit@debbugs.gnu.org; Tue, 13 Dec 2011 13:04:12 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-9.1 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([140.186.70.17]:44184) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RaWhz-0007vu-B2 for submit@debbugs.gnu.org; Tue, 13 Dec 2011 13:04:07 -0500 Received: from eggs.gnu.org ([140.186.70.92]:37832) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RaWht-0002pg-LB for bug-coreutils@gnu.org; Tue, 13 Dec 2011 13:04:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RaWhs-0007uX-L9 for bug-coreutils@gnu.org; Tue, 13 Dec 2011 13:04:01 -0500 Received: from mx1.redhat.com ([209.132.183.28]:26003) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RaWhs-0007u9-EQ for bug-coreutils@gnu.org; Tue, 13 Dec 2011 13:04:00 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id pBDI3tFF003455 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 13 Dec 2011 13:03:55 -0500 Received: from [10.3.113.112] (ovpn-113-112.phx2.redhat.com [10.3.113.112]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id pBDI3seX009972; Tue, 13 Dec 2011 13:03:54 -0500 Message-ID: <4EE7938A.1050101@redhat.com> Date: Tue, 13 Dec 2011 11:03:54 -0700 From: Eric Blake Organization: Red Hat User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20111115 Thunderbird/8.0 MIME-Version: 1.0 To: Kamil Dudka Subject: Re: bug#10282: change in behavior of du with multiple arguments (commit efe53cc) References: <201112121350.30539.kdudka@redhat.com> <201112131746.06025.kdudka@redhat.com> <4EE7885C.4080506@redhat.com> <201112131837.19023.kdudka@redhat.com> In-Reply-To: <201112131837.19023.kdudka@redhat.com> X-Enigmail-Version: 1.3.4 OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enigEC1DD6A73E7EE5E0E086537B" X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.17 X-Spam-Score: -8.0 (--------) X-Debbugs-Envelope-To: submit Cc: Paul Eggert , bug-coreutils@gnu.org, Jim Meyering , 10282@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -8.0 (--------) This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigEC1DD6A73E7EE5E0E086537B Content-Type: text/plain; charset=ISO-8859-6 Content-Transfer-Encoding: quoted-printable On 12/13/2011 10:37 AM, Kamil Dudka wrote: > On Tuesday 13 December 2011 18:16:12 Eric Blake wrote: >> I think the proposal is to add a new option that forces du to reset it= s >> duplicate inode hash table for each command line argument, to make >> behavior more like traditional du, even though it means -s can then >> output a larger usage by summing the first column than what you would >> get by the default behavior, when encountering command line arguments >> that are a duplicate with an inode already traversed earlier in the >> command line. --count-links isn't quite right, because you still want= >> to elide links within a single directory of the command-line argument.= >> Or maybe --count-links gains an optional argument, that says how to >> count links: >> >> --count-links=3Dnone -> POSIX behavior (if POSIX requires elision acro= ss >> command line arguments >> --count-links=3Dper-directory -> traditional behavior, resetting hash >> between command line arguments >> --count-links =3D=3D --count-links=3Dall -> count every file on every = encounter >=20 > What would be the difference between the 'per-directory' variant and in= voking=20 > du multiple times, giving it one argument at a time? Fewer forks. --=20 Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --------------enigEC1DD6A73E7EE5E0E086537B Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBCAAGBQJO55OKAAoJEKeha0olJ0Nq36IH+gIdoZfcCxwBbvLrAzQ13NHO kbbQVdq7DL/cJC5jyuXO9ULYN0g033FuCLb/TJpKyIx+WkBWSSOl/StHjOT4fuzx unxge+jKtctFWUx6EZ1CRhDXtwb366M6xemmJRs/hm5ETUUhcfL/NMSwClpZLEPl e6i697eOz4abdFDl4YPxnNZKUM6PwDE9U5BOkVHOdHnHeesJyD1tH1O0mtZ0RVzL +RfoR/gqMv4e8OQK7UbbSsAK2pXPzV9HdmhFRTZ7DO9132fib54mLN236faArpNx ro9tE9tJpfoerjw3yM1qwBkTyZmcbGKBra4Y4rVggW7quwqwMr0zpDMaYRgK0+A= =nO1t -----END PGP SIGNATURE----- --------------enigEC1DD6A73E7EE5E0E086537B-- From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 13 15:11:06 2011 Received: (at 10282) by debbugs.gnu.org; 13 Dec 2011 20:11:06 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RaYgr-0004S6-PR for submit@debbugs.gnu.org; Tue, 13 Dec 2011 15:11:06 -0500 Received: from smtp.cs.ucla.edu ([131.179.128.62]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RaYgp-0004Rz-AO for 10282@debbugs.gnu.org; Tue, 13 Dec 2011 15:11:04 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 0B60639E800A; Tue, 13 Dec 2011 12:09:43 -0800 (PST) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JV7EbCfc4IVn; Tue, 13 Dec 2011 12:09:42 -0800 (PST) Received: from penguin.cs.ucla.edu (Penguin.CS.UCLA.EDU [131.179.64.200]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 9DF6839E8006; Tue, 13 Dec 2011 12:09:42 -0800 (PST) Message-ID: <4EE7B106.3010001@cs.ucla.edu> Date: Tue, 13 Dec 2011 12:09:42 -0800 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20111115 Thunderbird/8.0 MIME-Version: 1.0 To: Eric Blake Subject: Re: bug#10282: change in behavior of du with multiple arguments (commit efe53cc) References: <201112121350.30539.kdudka@redhat.com> <4EE6A022.8060604@cs.ucla.edu> <87ehw9t0bv.fsf@rho.meyering.net> <201112131746.06025.kdudka@redhat.com> <4EE7885C.4080506@redhat.com> In-Reply-To: <4EE7885C.4080506@redhat.com> Content-Type: text/plain; charset=ISO-8859-6 Content-Transfer-Encoding: 7bit X-Spam-Score: -3.0 (---) X-Debbugs-Envelope-To: 10282 Cc: Kamil Dudka , Jim Meyering , 10282@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.0 (---) On 12/13/11 09:16, Eric Blake wrote: > Or maybe --count-links gains an optional argument, that says how to > count links: > > --count-links=none -> POSIX behavior (if POSIX requires elision across > command line arguments > --count-links=per-directory -> traditional behavior, resetting hash > between command line arguments > --count-links == --count-links=all -> count every file on every encounter Yes, that was the sort of thing that I had in mind. Though, like Kamil, I hadn't thought that the per-directory argument was all that useful, since one can simply invoke "du" multiple times to get that behavior. Your earlier message suggests another option, which could be --count-links=zero or something like that: it causes "du" to output a "0 X" line for every entry that would otherwise be elided because it's a duplicate. Or perhaps we could make that "-0 X" so that one can distinguish duplicates from true zero entries. Or perhaps it would be better to have a --count-links=mark option, which causes du to output "+N X" for a duplicate link, where N is the size, and the "+" marks it as a duplicate. Just thinking out loud.... At any rate it doesn't sound like it's high priority. From debbugs-submit-bounces@debbugs.gnu.org Sun May 20 17:18:42 2012 Received: (at control) by debbugs.gnu.org; 20 May 2012 21:18:42 +0000 Received: from localhost ([127.0.0.1]:35718 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SWDWC-0006Fw-2H for submit@debbugs.gnu.org; Sun, 20 May 2012 17:18:42 -0400 Received: from smtp.cs.ucla.edu ([131.179.128.62]:37303) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SWDVp-0006F3-8I; Sun, 20 May 2012 17:18:20 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 54FB239E800C; Sun, 20 May 2012 14:17:21 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id AmIcGrC4xaUZ; Sun, 20 May 2012 14:17:20 -0700 (PDT) Received: from [192.168.1.10] (pool-71-189-109-235.lsanca.fios.verizon.net [71.189.109.235]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 7649339E8008; Sun, 20 May 2012 14:17:20 -0700 (PDT) Message-ID: <4FB95F64.2020601@cs.ucla.edu> Date: Sun, 20 May 2012 14:17:24 -0700 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; Linux i686; rv:12.0) Gecko/20120430 Thunderbird/12.0.1 MIME-Version: 1.0 To: Chris Marusich Subject: Re: bug#11526: "du -s . foo bar" only outputs size of first argument -- versions 8.13, 8.16, and 8.17 (latest) References: In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: control Cc: 11526@debbugs.gnu.org, control@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) forcemerge 10282 11526 thanks Thanks, but this behavior is expected and is not a bug. We have been looking into ways of addressing the issue, though there's nothing currently active in this area. For more, please see . From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 15 11:03:27 2018 Received: (at control) by debbugs.gnu.org; 15 Oct 2018 15:03:27 +0000 Received: from localhost ([127.0.0.1]:50923 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gC4P1-000675-B1 for submit@debbugs.gnu.org; Mon, 15 Oct 2018 11:03:27 -0400 Received: from mail-pf1-f177.google.com ([209.85.210.177]:37578) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gC4Oz-00066p-ME; Mon, 15 Oct 2018 11:03:26 -0400 Received: by mail-pf1-f177.google.com with SMTP id j23-v6so9817940pfi.4; Mon, 15 Oct 2018 08:03:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:cc:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=gjMLzo04dDb92of69bppwHovWbW/unMKFCbLg50iFvk=; b=BQ/VyYVC4wTODPFClMuwi23MyM8VD+BUP4p294ukcYauJ8zcTDvjDqKglBe1+xBPFI +NlZWOhZAp6SFRvKLwMBRyzzvpRCaXFOzp8Kfz751unB6CPcwZ2UJ/Yc37v4MQYvuLUg qsghf/0NSh54gX/7A3sMU7ktqnQszq2FInRl+RzoCKcksPDMfPG2ISj8jt7hHrLcGm7g YMYd7YPW9AnaUEEa0bywLP4Dlx42LPpUaui0QO5PZpCWqG6uCGtT10NA83dfEdtKFECX 9Miu59dhDNEtmM0Ee355Drnp9D6JB/c7HBblXIzUYQkeQPlECEpxa7Yo32MJH4NwJOR0 t0Ow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=gjMLzo04dDb92of69bppwHovWbW/unMKFCbLg50iFvk=; b=BPpZcXZfV6tqJwf59fBTa9NaVaVmQd1srIMjPYTp7syOw0qBjMVTasEpccZJlumy2e ian14ERJLWj7DlvRVvJkfLyKe7rMEiT1hXY6V+atJUxSToOAB7EfPGpN8QXfcCSZ34aY ckiqDSWs8CAgOxP9eiHOdr8yeedkS/GIUIG1cdkZM0L/MDxvK4hx6w5Y73LIItuJEvtW 0SFo7yq7+eeviJKu3Uwgy6YjysKjgKCRQb+MwCJh5NNnCKVQdxmyG1l+d+WApdSfkAqW i2Gt/cJkcI2rVKwq4Q0iRxHrZ46ubhlVeUDi7RNovGaVHsQeWbHc5KHaPfH2KCYmPWW3 Cy6A== X-Gm-Message-State: ABuFfogDmuziOgI58rSUO5NougbwB3CAQ7A4ZvI4UbIe9aKX7qW54+hH 0tNbf0POu8dT74YLQejJvO4u04zCuKk= X-Google-Smtp-Source: ACcGV63uNFSoaoCQdyJPb4ppDWeW2byaXAv3mBqmQiFifztq2aXaNAmRkL4rYJul4BIL5zWEKWxmZw== X-Received: by 2002:aa7:8001:: with SMTP id j1-v6mr17712551pfi.73.1539615798921; Mon, 15 Oct 2018 08:03:18 -0700 (PDT) Received: from tomato.housegordon.com (moose.housegordon.com. [184.68.105.38]) by smtp.googlemail.com with ESMTPSA id g88-v6sm16283473pfd.181.2018.10.15.08.03.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Oct 2018 08:03:17 -0700 (PDT) Subject: Re: bug#10281: change in behavior of du with multiple arguments (commit efe53cc) References: <4EE64133.6070309@cs.ucla.edu> <51207435.2060901@cs.ucla.edu> <5122DBE2.10603@cs.ucla.edu> <5123AA4E.4020308@cs.ucla.edu> <5124A23D.1070100@tlinx.org> From: Assaf Gordon Message-ID: <5943df53-cebe-5db0-67b4-1a1b9d56c169@gmail.com> Date: Mon, 15 Oct 2018 09:03:16 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <5124A23D.1070100@tlinx.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: 1.2 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: severity 10281 wishlist tags 10281 wontfix retitle 10281 du: hard-links counting with multiple arguments (commit efe53cc) close 10281 (triaging old bugs) [...] On 18/02/13 01:18 AM, Elliott Forney wrote: >> My reading of >> is that POSIX allows but does not require the current GNU behavior, >> and that future versions of POSIX may require the current GNU behavior. > > Thanks Paul, I agree with your reading of this. Sounds like POSIX > allows both the new and old behaviors. [...] Content analysis details: (1.2 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.2 MISSING_HEADERS Missing To: header 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (assafgordon[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [209.85.210.177 listed in list.dnswl.org] X-Debbugs-Envelope-To: control Cc: 10281@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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.2 (/) severity 10281 wishlist tags 10281 wontfix retitle 10281 du: hard-links counting with multiple arguments (commit efe53cc) close 10281 (triaging old bugs) [...] On 18/02/13 01:18 AM, Elliott Forney wrote: >> My reading of >> is that POSIX allows but does not require the current GNU behavior, >> and that future versions of POSIX may require the current GNU behavior. > > Thanks Paul, I agree with your reading of this. Sounds like POSIX > allows both the new and old behaviors. Long and interesting thread about du, hard-links, and POSIX interpretations, but with no follow-up in 5 years and no change in du's behavior, I'm closing this bug. regards, - assaf From unknown Wed Sep 10 12:53:42 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 13 Nov 2018 12:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator