public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Cc: Frodo Looijaard <frodol@dds.nl>, linux-kernel@vger.kernel.org
Subject: Re: PATCH to access old-style FAT fs
Date: Tue, 27 Jan 2004 10:51:02 -0800	[thread overview]
Message-ID: <4016B316.4060304@zytor.com> (raw)
In-Reply-To: <87n0898sah.fsf@devron.myhome.or.jp>

OGAWA Hirofumi wrote:
> 
> The new cluster for directory entries must be initialized by 0x00.
> And, when the directory entry is deleted, the name[0] is updated by
> 0xe5 not 0x00.
> 
> So, if the name[0] is 0x00, it after, all bytes in cluster is 0x00.
> 
> The fat driver can stop at name[0] == 0x00, but this is just optimization.
> The behavior shouldn't change by this.

I looked at the spec, and yes, that is how the spec reads:

If DIR_Name[0] == 0x00, then the directory entry is free (same as for
0xE5), and there are no allocated directory entries after this one (all
of the DIR_Name[0] bytes in all of the entries after this one are also
set to 0). The special 0 value, rather than the 0xE5 value, indicates to
FAT file system driver code that the rest of the entries in this
directory do not need to be examined because they are all free.

I guess the original poster has found filesystems which have a 0
followed by garbage.  In cases like that, the cardinal rule for FAT is
WWDD (What Would DOS Do)... since I'm pretty sure DOS stops examining at
that point, we should do the same.

It's the same thing as with using 0xF8 for ending clusters; it's correct
according to spec, but WWDD says 0xFF is the right thing.

	-hpa


  reply	other threads:[~2004-01-27 18:51 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-26 17:39 PATCH to access old-style FAT fs Frodo Looijaard
2004-01-26 19:38 ` H. Peter Anvin
2004-01-27 12:55   ` OGAWA Hirofumi
2004-01-27 18:51     ` H. Peter Anvin [this message]
2004-01-27 20:17       ` OGAWA Hirofumi
2004-01-28 11:56         ` Frodo Looijaard
2004-01-28 20:08           ` OGAWA Hirofumi
2004-01-28 20:24             ` Frodo Looijaard
2004-01-28 21:01               ` OGAWA Hirofumi
2004-01-29 10:56                 ` Frodo Looijaard
2004-01-31  2:19                   ` H. Peter Anvin
2004-01-31 17:19                     ` OGAWA Hirofumi
2004-01-29 22:39                 ` Frodo Looijaard
2004-01-29 22:49                   ` H. Peter Anvin
2004-01-30  0:30                   ` Andries Brouwer
2004-01-30  3:40                   ` OGAWA Hirofumi
2004-02-01 14:51                   ` Frodo Looijaard

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=4016B316.4060304@zytor.com \
    --to=hpa@zytor.com \
    --cc=frodol@dds.nl \
    --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