After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 313668 - Nautilus Properties incorrectly totals sizes of hardlinked files
Nautilus Properties incorrectly totals sizes of hardlinked files
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: File Properties Dialog
2.11.x
Other All
: Normal normal
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
: 332069 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2005-08-16 21:52 UTC by Sebastien Bacher
Modified: 2008-05-23 17:40 UTC
See Also:
GNOME target: ---
GNOME version: 2.11/2.12



Description Sebastien Bacher 2005-08-16 21:52:16 UTC
This bug has been opened here: https://bugzilla.ubuntu.com/show_bug.cgi?id=12519

"I have a baz revision library, and wanted to know how much disk space it is
taking up. I right-clicked on the directory using nautilus and went to
properties. It came up with a total filesize of 40.2 GB. 'du -s' on the other
hand reported about 4 GB. Lots of files in the revision library are hardlinked
together - hence nautilus is naively adding the file sizes together instead of
noting which files occupy the same space."
Comment 1 Christian Neumair 2005-09-03 13:50:30 UTC
Thanks for your bug report!
This is indeed very ugly. The relevant code is in
libnautilus-private/nautilus-directory-async.c. We seem to do this wrong for
symlinks as well. Technically, there is no way to detect that we have a
hardlinks except by comparing the inodes of all scanned files, right?
Comment 2 Fabio Marzocca 2005-09-16 19:19:06 UTC
In baobab ( http://www.marzocca.net/linux/baobab.html ) I am handling hardlinks
this way: when the user starts a full disk scan, baobab sets up an array of
hardlinks (by comparing inodes). Then, the first hardlink is counted as a normal
file, while the subsequent links to the same inode device are not counted in the
total, but highlighted in the right-hand column of the window.
Comment 3 Nickolay V. Shmyrev 2006-03-14 17:44:57 UTC
*** Bug 332069 has been marked as a duplicate of this bug. ***
Comment 4 gnome 2008-02-13 18:05:56 UTC
I was coming to report the very same bug. Except that now we are using Gnome 2.20 and soon 2.22.

The proposed solution in comment #2 seems elegant, at least I would have used this logic in another context.

If I set a patch implementing this solution, would it have any chance to be accepted? For Gnome 2.24 now I guess.
Comment 5 A. Walton 2008-05-05 23:24:59 UTC
Patches are very welcome, please do.
Comment 6 Christian Neumair 2008-05-23 17:40:13 UTC
I committed a fix to trunk and to the GNOME 2.22 branch:

http://svn.gnome.org/viewvc/nautilus?view=revision&revision=14189
http://svn.gnome.org/viewvc/nautilus?view=revision&revision=14190

The hardlinks will be counted as objects, but the size will just be counted once.

Closing as fixed.