Re: *FAT problem in 2.6.0-test8

From: Andries Brouwer
Date: Sat Oct 25 2003 - 06:07:19 EST


On Sat, Oct 25, 2003 at 07:18:03PM +0900, OGAWA Hirofumi wrote:

> It looks like it doesn't conform to Microsoft's or SmartMedia's
> specifications.
>
> Yes. It will be important to know how it was formated.

Yesterday I wondered whether I should propose a patch,
say something like

--- /linux/2.6/linux-2.6.0test6/linux/fs/fat/inode.c Sat Aug 9 22:16:54 2003
+++ ./inode.c Sat Oct 25 00:04:18 2003
@@ -931,13 +931,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 once 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;
}

but maybe a single report does not suffice. It would be good to confirm
that certain devices write 0 there. (I would have asked the reporter
to do "dd if=/dev/zero of=/dev/something" and reinsert the card into
the camera, but fiddling with smartmedia cards is a bit dangerous -
not all readers and not all cameras are able to recover from such a
situation, so the card might become unusable without access to other
readers or other cameras.)

Andries

[BTW - Does anyone have more information about this other nonstandard
value, apparently found on pc9800?]

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/