bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#7399: du may count one file multiple times if it visible through mul


From: Paul Eggert
Subject: bug#7399: du may count one file multiple times if it visible through multiple mounts
Date: Sun, 14 Nov 2010 23:16:42 -0800
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.12) Gecko/20101027 Thunderbird/3.1.6

On 11/14/2010 05:16 AM, Evgeny Kapun wrote:
> Some kernels, such as Linux, permit mounting one filesystem multiple
> times. This can make multiple paths refer to the same file, although
> neither hard nor symbolic links are involved.

GNU du (as well as a lot of other programs I expect) doesn't work well
in such environments, which do not conform to POSIX requirements for
file system link counts.  GNU du could easily be fixed to handle these
environments, but at a substantial runtime cost in the normal case,
because it'd have to hash every file it runs across, not just files
with link counts > 1 or that result from multiple arguments.

One possible workaround is to add an option, --hash-all-files say, which causes
du to hash every file it runs across, and thus not double-count files
in such cases.

(Another possible workaround is to tell users "don't do that".  :-)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]