Bug 135611 - Filelight doesn't distinguish sparse files
Summary: Filelight doesn't distinguish sparse files
Alias: None
Product: filelight
Classification: Applications
Component: general (show other bugs)
Version: 1.0
Platform: Compiled Sources Linux
: NOR normal with 81 votes (vote)
Target Milestone: ---
Assignee: Martin Sandsmark
Depends on:
Reported: 2006-10-14 07:23 UTC by Stephan Sokolow
Modified: 2010-06-04 22:52 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Note You need to log in before you can comment on or make changes to this bug.
Description Stephan Sokolow 2006-10-14 07:23:07 UTC
Version:           1.0 (using KDE KDE 3.5.2)
Installed from:    Compiled From Sources
Compiler:          Target: i686-pc-linux-gnu
OS:                Linux (i686) release 2.6.17-gentoo-r4-20060825

Filelight doesn't measure the space consumed by sparse files properly. As such, the consumption breakdown can be skewed greatly by incomplete torrents. (or incomplete files from any other P2P system which allocates sparse files and then fills them)
Comment 1 Stephan Sokolow 2006-10-14 07:31:56 UTC
Um... oops. Can someone please move this from i18n-->filelight to filelight-->general?
Comment 2 Gioele Barabucci 2006-12-15 03:54:33 UTC
It still happens with filelight 1.0 and KDE 3.5.5.
Comment 3 Raúl 2008-01-08 11:02:20 UTC
Is there any news about this?

Comment 4 Roman Cheplyaka 2009-05-08 12:17:26 UTC
*** This bug has been confirmed by popular vote. ***
Comment 5 Martin Sandsmark 2010-05-27 01:28:30 UTC
Huh, are you sure?

Filelight gets the filesize by stat()ing, and ST_NBLOCKS(statbuf) * ST_NBLOCKSIZE, which should be the actual number of blocks on the disk multiplied with block size (statbuf.st_size would be the normal "size", which should be larger than the blocks*blocksize in the case of sparse files). But please correct me if I'm wrong.
Comment 6 Stephan Sokolow 2010-05-28 02:29:16 UTC
I'll try to confirm in the next few days. At the moment, I'm still reinstalling my system and FileLight hasn't been reinstalled yet.

(And I'm still a bit iffy about installing 1.9 since, as far as I can tell, something in my path structure causes Qt4 versions of FileLight to freeze part way through gathering information)
Comment 7 Martin Sandsmark 2010-05-28 02:34:24 UTC
I thought I fixed that freezing bug, I should probably release a new rc now, I've fixed a lot of bugs since the last one.

Could you try the SVN version?
Comment 8 Stephan Sokolow 2010-05-28 04:51:46 UTC
When I get to it tomorrow or the next day? Sure. I just checked and there is an SVN ebuild, so I have no problem trying that instead.
Comment 9 Stephan Sokolow 2010-05-30 05:30:40 UTC
The freezing problem is fixed in SVN, but the "doesn't distinguish sparse files" problem remains.

Steps to reproduce:
1. Change to a folder with almost nothing in it (eg. ~/.ssh)
2. touch foo
3. truncate -s 50M foo
4. Compare the output of du and filelight.

For all intents and purposes, filelight treats the sparse file as if it were actually taking up 50 MiB while du lists it as consuming the amount of space it actually consumes unless you pass the --apparent-size flag.
Comment 10 Martin Sandsmark 2010-06-04 22:52:11 UTC
SVN commit 1134661 by sandsmark:

Fix handling of sparse files.

Don't fake the reading of blocks used for a file.

BUG: 135611

 M  +3 -9      localLister.cpp  

WebSVN link: http://websvn.kde.org/?view=rev&revision=1134661