linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Karcher <kernel@mkarcher.dialup.fu-berlin.de>
To: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Cc: dosfstools <daniel@debian.org>, mtools <Alain@linux.lu>,
	linux-kernel@vger.kernel.org
Subject: Re: End of FAT directories
Date: Fri, 22 Apr 2011 23:56:48 +0200	[thread overview]
Message-ID: <1303509408.8485.146.camel@localhost> (raw)
In-Reply-To: <87hb9qnho4.fsf@devron.myhome.or.jp>

Am Samstag, den 23.04.2011, 05:40 +0900 schrieb OGAWA Hirofumi:


> It is simply the bug of Sony devices, and can't work on it for both of
> Windows and Linux (it have to be fixed by fsck).
You are right. Although as the sony device *does* clear out the first 8K
of the 16K cluster, that makes 256 correctly working directory entries.
This directory is only used for storing a dozen of files with no long
names, the existing problem you correctly describe is not relevant in
practice.

> Assume 0-3 directory entires fine, 4 is zeroed entry, and 5- is crappy data.
> 
> 1| ENT1        valid
> 2| ENT2        valid
> 3| ENT3        valid
> 4|             zeroed
> 5| djafdjoi    crappy data
> ...
> 
> Windows will stop at 4, but if windows write new entry as 4, 5- will
> show those up as crap like linux.
You are right. Thanks for your input. This means Windows and mtools
behave exactly the same way (and thus mtools can not really be
considered buggy). I expected Windows to fix up the end, but it does
not.

I still would prefer greatly if Windows and Linux at least read media
the same way (i.e. stop on the first zeroed entry), I even have a patch
for that somewhere around I can dig out.
I furthermore think it is quite important for dosfsck and the linux
kernel to behave consistent (think of valid entries after the zeroed
entry linking to "lost clusters"). If I prepare patches for the Linux
kernel to
 - terminate reading at the first zeroed entry
 - making sure that if a zeroed entry gets populated, the next entry
gets zeroed unless we hit the end of the directory (deviating from
Windows behaviour, intentionally, to keep the filesystem consistent)
And for dosfsck to
 - terminate reading at the first zeroed entry
 - offer filling the remainder of a directory cluster with zero bytes.
Would this set of patches be acceptable?


> In short, in spec, directory must be initialized by
> zero (it is same assumption on linux and windows).
Turns out you are right. Sorry for making the implicit assumption that
windows handles the case better.

Regards,
  Michael Karcher


  reply	other threads:[~2011-04-22 21:52 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-22 18:48 End of FAT directories Michael Karcher
2011-04-22 18:51 ` End of FAT directories (added missing reference) Michael Karcher
2011-04-22 20:40 ` End of FAT directories OGAWA Hirofumi
2011-04-22 21:56   ` Michael Karcher [this message]
2011-04-23  0:06     ` OGAWA Hirofumi
2011-04-23 11:38       ` Michael Karcher
2011-04-23 13:46         ` OGAWA Hirofumi
2011-04-28 13:25         ` Pavel Machek
2011-04-28 13:43           ` Michael Karcher
2011-04-28 15:44             ` OGAWA Hirofumi
2011-06-28 23:09               ` Alain Knaff
2011-04-28 20:51             ` Pavel Machek

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=1303509408.8485.146.camel@localhost \
    --to=kernel@mkarcher.dialup.fu-berlin.de \
    --cc=Alain@linux.lu \
    --cc=daniel@debian.org \
    --cc=hirofumi@mail.parknet.co.jp \
    --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;
as well as URLs for NNTP newsgroup(s).