GNU bug report logs - #10281
du: hard-links counting with multiple arguments (commit

Previous Next

Package: coreutils;

Reported by: Paul Eggert <eggert <at> cs.ucla.edu>

Date: Mon, 12 Dec 2011 18:02:02 UTC

Severity: wishlist

Tags: wontfix

Merged with 10282, 11526

Done: Assaf Gordon <assafgordon <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


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

From: Elliott Forney <idfah <at> cs.colostate.edu>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 10281 <at> debbugs.gnu.org
Subject: Re: bug#10281: change in behavior of du with multiple arguments
	(commit efe53cc)
Date: Tue, 19 Feb 2013 16:26:17 -0700
> Unfortunately if memory serves that's not the case either.
> In non-GNU implementations, multiple links are sometimes counted
> and sometimes not.  If you run 'du a b' and a/f and b/f
> are hard links, they might be counted twice, and might not be -- it
> depends on the implementation.

I wasn't aware of that, sounds like there have been inconsistencies
for a long time.

> The area is indeed a mess and no matter what GNU du does it will
> disagree with somebody.

Sure.  As you stated before, filesystems are inherently complex,
especially when links are allowed.  I agree with that.  I apologize if
I am being difficult.  I just want to be sure this discussion is had
because it seems like this is a significant change in behavior.  It
does make sense, it just doesn't feel intuitive to me.

> It might be reasonable to add an option to GNU du to have it mimic
> the behavior you prefer, if we can nail down exactly what that is.

Well, what really bothers me is the second command below.

$ du -ks tmp tmp/bash
1033864	tmp

$ du -ks tmp/bash tmp
182684	tmp/bash
851180	tmp

The size of tmp is underrepresented even though there are no links.
To be honest, however, I can't think of a good way around this.  It
would be nice to simply omit tmp/bash since it is in a directory under
another argument but I'm unsure how that would be achieved without
making things even more convoluted and less efficient.  I am at a
loss.

Once a user is aware of what is going on, the problem can be avoided
either by using multiple du commands or by using --count-links and
understanding that any totals and links may be overcounted.  If you
are confident this is the best way to go forward then I can live with
it.




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

Previous Next


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