mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andries.Brouwer@cwi.nl
To: Andries.Brouwer@cwi.nl, torvalds@osdl.org
Cc: linux-kernel@vger.kernel.org
Subject: Re: Linux 2.6.0-test9
Date: Sun, 26 Oct 2003 12:08:08 +0100 (MET)	[thread overview]
Message-ID: <UTC200310261108.h9QB88m25135.aeb@smtp.cwi.nl> (raw)

> Pls forward.

The first FAT entry should have the media byte (0xf0,0xf8,...,0xff)
extended with all 1 bits in the first FAT entry.
Checking this is a good idea, it prevents us from mounting garbage
as FAT - there is no good magic for FAT.
Unfortunately, Windows does not enforce this, and 2.4 doesn't either.
It turns out that there are filesystems around (two reports so far)
that have a zero first FAT entry, and work under Windows and 2.4 but
fail to mount under 2.6.

So, the below weakens the test.

Andries

[one report was with a SmartMedia card, the other with an
Archos Jukebox Recorder 20]

diff -u --recursive --new-file -X /linux/dontdiff a/fs/fat/inode.c b/fs/fat/inode.c
--- a/fs/fat/inode.c	Wed Oct 22 23:25:26 2003
+++ b/fs/fat/inode.c	Sun Oct 26 02:31:24 2003
@@ -964,13 +964,17 @@
 		error = first;
 		goto out_fail;
 	}
-	if (FAT_FIRST_ENT(sb, media) != first
-	    && (media != 0xf8 || FAT_FIRST_ENT(sb, 0xfe) != first)) {
-		if (!silent) {
+	if (FAT_FIRST_ENT(sb, media) == first) {
+		/* all is as it should be */
+	} else if (media == 0xf8 && FAT_FIRST_ENT(sb, 0xfe) == first) {
+		/* bad, reported on pc9800 */
+	} else if (first == 0) {
+		/* bad, reported with a SmartMedia card */
+	} else {
+		if (!silent)
 			printk(KERN_ERR "FAT: invalid first entry of FAT "
 			       "(0x%x != 0x%x)\n",
 			       FAT_FIRST_ENT(sb, media), first);
-		}
 		goto out_invalid;
 	}
 

             reply	other threads:[~2003-10-26 11:08 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-26 11:08 Andries.Brouwer [this message]
2003-10-26 13:57 ` OGAWA Hirofumi
  -- strict thread matches above, loose matches on Subject: below --
2003-10-27 10:58 Andries.Brouwer
2003-10-27  9:47 Mikael Pettersson
2003-10-27  1:48 Andries.Brouwer
2003-10-27  2:10 ` Linus Torvalds
2003-10-27  9:40   ` David S. Miller
2003-10-26 19:40 Andries.Brouwer
2003-10-27  0:01 ` Andrew Morton
2003-10-27  0:21   ` Linus Torvalds
2003-10-27  0:28     ` Linus Torvalds
2003-10-27  6:43       ` David S. Miller
2003-10-27 19:54         ` kuznet
2003-10-27 19:36     ` kuznet
2003-10-28  0:42       ` Tommy Christensen
2003-10-28 18:25         ` kuznet
2003-10-26 18:51 P. Christeas
2003-10-27  3:16 ` Andrew Morton
2003-10-26 15:32 Shane Shrybman
2003-10-26 16:27 ` Marco Roeland
2003-10-26 10:59 Andries.Brouwer
2003-10-27 23:37 ` bill davidsen
2003-10-26 10:26 Andries.Brouwer
2003-10-26  1:16 Andries.Brouwer
2003-10-26  3:12 ` OGAWA Hirofumi
2003-10-26  5:48 ` Linus Torvalds
2003-10-27 23:26   ` bill davidsen
2003-10-30  9:20     ` Russell King
2003-10-30 16:44       ` Bill Davidsen
2003-10-30 17:23         ` John Bradford
2003-10-25 19:09 Linus Torvalds
2003-10-25 19:52 ` Marcelo Tosatti
2003-10-25 20:14 ` viro
2003-10-25 22:35   ` Linus Torvalds
2003-10-25 23:45 ` Jose Luis Domingo Lopez
2003-10-26 12:05 ` Patrik Wallstrom
2003-10-27 18:21   ` Patrik Wallstrom
2003-10-27 22:51     ` bill davidsen
2003-10-28  2:12       ` Jeff Garzik
2003-10-28  4:52         ` Bill Davidsen

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=UTC200310261108.h9QB88m25135.aeb@smtp.cwi.nl \
    --to=andries.brouwer@cwi.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.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

all inboxes | Powered by JetHome®