mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bodo Eggert <7eggert@gmx.de>
To: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>,
	Juergen Beisert <juergen127@kreuzholzen.de>,
	linux-kernel@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: Wrong free clusters count on FAT32
Date: Sun, 22 Apr 2007 15:28:50 +0200	[thread overview]
Message-ID: <E1Hfc7X-00010D-09@be1.lrz> (raw)
In-Reply-To: <8cwz8-2fE-13@gated-at.bofh.it>

OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> wrote:

>>  * Juergen Beisert <juergen127@kreuzholzen.de> dixit:

>>> 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).

AFAIR it's stored twice on FAT32, once in a backup sector and once in the
superblock or extended superblock (don't remember, I think it was the
extended ~). It's not stored on FAT{12,16}.

>>     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?

Windows _does_ care*, it will pretend the disk to be full. Therefore the
stored value *SHOULD* be updated. (I think your patch does this.)

Recalculating the free space is a nice idea, and modern hardware might be
fast enough to recalculate the value on mount by default. (I didn't try this
for years.) Maybe the default should depend on arch?


About this patch: (news:8cwz8-2fE-13@gated-at.bofh.it)

- usefree is a bad name (I'd suggest recalc_free instead), and your
  description is too cryptic to be understood by a non-linux FAT expert.
- You forgot to update Documentation/
-- 
Never forget: 2 + 2 = 5 for extremely large values of 2. 

Friß, Spammer: NyjnoQ@0S0gJr.7eggert.dyndns.org uh@e.7eggert.dyndns.org
 VnmVge7Vj@3tlxued.7eggert.dyndns.org RggsNsl@al.7eggert.dyndns.org

       reply	other threads:[~2007-04-22 13:29 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <8bAF0-3Yj-29@gated-at.bofh.it>
     [not found] ` <8bDta-8rc-31@gated-at.bofh.it>
     [not found]   ` <8bFEr-3B4-1@gated-at.bofh.it>
     [not found]     ` <8cwz8-2fE-13@gated-at.bofh.it>
2007-04-22 13:28       ` Bodo Eggert [this message]
2007-04-22 14:04         ` OGAWA Hirofumi
2007-04-22 14:29           ` OGAWA Hirofumi
2007-04-22 14:53             ` Andreas Schwab
2007-04-22 15:13               ` OGAWA Hirofumi
2007-04-22 21:46           ` Bodo Eggert
2007-04-23  2:20             ` OGAWA Hirofumi
2007-04-22 20:11         ` DervishD
     [not found]       ` <8cAMl-du-3@gated-at.bofh.it>
     [not found]         ` <8cBS7-1Qa-1@gated-at.bofh.it>
     [not found]           ` <8cIqE-3qZ-9@gated-at.bofh.it>
     [not found]             ` <8cITG-40H-5@gated-at.bofh.it>
2007-04-22 17:21               ` Bodo Eggert
2007-04-22 17:44                 ` OGAWA Hirofumi
2007-04-19  8:57 DervishD
2007-04-19 10:27 ` Boaz Harrosh
2007-04-19 14:23   ` DervishD
2007-04-19 11:52 ` Juergen Beisert
2007-04-19 14:19   ` DervishD
2007-04-21 22:42     ` OGAWA Hirofumi
2007-04-22  3:18       ` Andrew Morton
2007-04-22  4:26         ` OGAWA Hirofumi
2007-04-22 11:26           ` DervishD
2007-04-22 11:55             ` OGAWA Hirofumi
2007-04-22 20:08               ` DervishD
2007-04-23  2:27                 ` OGAWA Hirofumi
2007-04-23  6:19                   ` DervishD
2007-04-22 11:17       ` DervishD
2007-04-22 11:28       ` Juergen Beisert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1Hfc7X-00010D-09@be1.lrz \
    --to=7eggert@gmx.de \
    --cc=akpm@linux-foundation.org \
    --cc=hirofumi@mail.parknet.co.jp \
    --cc=juergen127@kreuzholzen.de \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome