lkml.org 
[lkml]   [2007]   [Apr]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Wrong free clusters count on FAT32
    Hi Ogawa (and Andrew) :)
* OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> dixit:
> Andrew Morton <akpm@linux-foundation.org> writes:
> > Is there some way in which we can work out what's happened and fix
> > it up?
>
> It seems that the recent Windows changed specification, and it's
> undocumented. Windows doesn't update ->free_clusters correctly.
>
> Probably, what we can do is to throw away speed of statfs(2) and not
> using ->free_clusters. (And if possible, recover it by optimization.)

Even if Windows updates ->free_clusters correctly, it doesn't even
consider it to compute the number of free clusters, and IMHO Linux
should do the same. If speed is a concern, ->free_clusters can be
computed at mount time. That way statfs won't slow.

The problem is that if a program writes a file onto the filesystem
without using statfs first to check for free space, the free_clusters
entry won't have the real value and the driver may report "disk full" (I
haven't read the code for the vfat driver, sorry, so I'm not sure about
this) when really there are plenty of clusters to write the new file.

Probably it's stupid to update the free clusters count at mount time
(sorry if so...) but it looks like a good idea to me. And of course, I
don't mean to update the value _on disk_, but the kernel's idea of free
clusters (so even FAT filesystems mounted R/O will report correct
values).

Raúl Núñez de Arenas Coronado

--
Linux Registered User 88736 | http://www.dervishd.net
It's my PC and I'll cry if I want to... RAmen!
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2007-04-22 13:27    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site