[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87d51xtkmp.fsf@duaron.myhome.or.jp>
Date: Sun, 22 Apr 2007 07:42:22 +0900
From: OGAWA Hirofumi <hirofumi@...l.parknet.co.jp>
To: Juergen Beisert <juergen127@...uzholzen.de>
Cc: linux-kernel@...r.kernel.org
Subject: Re: Wrong free clusters count on FAT32
DervishD <lkml@...vishd.net> writes:
> * Juergen Beisert <juergen127@...uzholzen.de> dixit:
>> On Thursday 19 April 2007 10:57, DervishD wrote:
>> > I have a portable device with a FAT32 formatted hard disk in it, and
>> > everytime I delete a file in the device *using the device itself to
>> > do it* the device increases its count of free space and if I plug
>> > the device in a Windows system, Windows agrees on the free space.
>> > Linux doesn't. Linux believes that the files are still there
>> > ocuppying space, and I have to run fsck.vfat to fix the problem.
>>
>> As I remember: It needs a large amount of time to calculate the free
>> space on a big FAT32 system.
>
> Big fat truth, I'm afraid. The thing is that I thought that Linux
> did that from time to time to update the count. Obviously, doing it for
> every statfs call would be very expensive :((
>
>> So the last free sector count is also stored. When mounting this
>> filesystem you don't need to walk through the whole FAT to calculate
>> the available space, you can use this "cached" value instead. And this
>> cached value seems not to be updated in your portable device.
>
> It doesn't, certainly, but Windows doesn't care. Moreover, the
> device doesn't seem to recalculate the value on every run (unless it
> does it lightning fast!), so maybe the number is stored elsewhere (the
> count can be stored in many places as far as I've read, but I don't know
> the details).
>
> A mount option to force walking the FAT and getting the real info
> could be interesting. That way, it will be only done for certain devices
> (small disks, for example).
Yes. It seems that Windows does not update the ->free_clusters correctly.
Probably, I think the option is good for now. What do you think about
an attached patch?
--
OGAWA Hirofumi <hirofumi@...l.parknet.co.jp>
View attachment "fat_ignore_free_clusters.patch" of type "text/x-diff" (3187 bytes)
Powered by blists - more mailing lists