bug-coreutils
[Top][All Lists]
Advanced

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

Re: DU and hard links


From: Jim Meyering
Subject: Re: DU and hard links
Date: Sun, 28 Mar 2004 23:45:36 +0200

Anthony Thyssen <address@hidden> wrote:
> I have a series of backup home directories what use hardlinks on files
> that have not changed.   If I run "du" on these directories I get
> a disk usage summery as if the directories are not hard linked together!

Actually, I see now that there is a bug.
Thank you for reporting it.
Here's a fix:

2004-03-28  Jim Meyering  <address@hidden>

        Under some circumstances, without -c, du would mistakenly count the
        space of hard-linked files, not just the first one it encountered.
        Reported by Anthony Thyssen.
        * src/du.c (du_files): Don't ever clear the set of `seen' dev/inodes.

Index: src/du.c
===================================================================
RCS file: /fetish/cu/src/du.c,v
retrieving revision 1.192
diff -u -p -u -p -r1.192 du.c
--- src/du.c    27 Mar 2004 15:44:23 -0000      1.192
+++ src/du.c    28 Mar 2004 08:13:42 -0000
@@ -518,12 +519,6 @@ du_files (char **files, int bit_flags)
            }
          FTS_CROSS_CHECK (fts);
 
-         /* This is a space optimization.  If we aren't printing totals,
-            then it's ok to clear the duplicate-detection tables after
-            each command line hierarchy has been processed.  */
-         if (ent->fts_level == 0 && ent->fts_info == FTS_D && 
!print_grand_total)
-           hash_clear (htab);
-
          process_file (fts, ent);
        }
 




reply via email to

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