linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Libvolume incorrectly detects FAT32
@ 2006-03-06 20:57 iSteve
  2006-03-06 21:59 ` Michael Buesch
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: iSteve @ 2006-03-06 20:57 UTC (permalink / raw)
  To: linux-hotplug

[-- Attachment #1: Type: text/plain, Size: 836 bytes --]

Hello,
I'm having one silly partition, which has remnants of previous FAT32 filesystem
on it, a LILO bootloader on it and ext2 filesystem spaning all over the
partition.

The first 512B look exactly like a valid FAT partition header would, except the
magic is "LILO". 

I've looked at the sources for FAT detection, and I noted that when a FAT-like
filesystem misses magic, it's still considered valid, since as comment says,
some old floppies may lack it. I consider this point valid, however, this
causes my partition to be detected, incorrectly, as FAT32.

My proposed solution is to compare magic if FAT32 is assumed, and if magic will
not match for FAT32, consider it a failure; floppies that old that they lack
any magic will most likely not be formatted in FAT32.

Trivial patch is attached, comments/complaints?:)
-- 
 -- iSteve

[-- Attachment #2: fat32-magic-required.patch --]
[-- Type: text/x-patch, Size: 318 bytes --]

--- fat.c.old	2006-01-30 08:51:38.000000000 +0100
+++ fat.c	2006-03-06 21:55:29.000000000 +0100
@@ -281,6 +281,9 @@
 	goto found;
 
 fat32:
+	if (memcmp(vs->type.fat32.magic, "FAT32   ", 8) != 0)
+		return -1;
+
 	strcpy(id->type_version, "FAT32");
 
 	/* FAT32 root dir is a cluster chain like any other directory */

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2006-03-08  5:57 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-06 20:57 Libvolume incorrectly detects FAT32 iSteve
2006-03-06 21:59 ` Michael Buesch
2006-03-06 22:37 ` Kay Sievers
2006-03-07 17:01 ` iSteve
2006-03-07 17:15 ` Kay Sievers
2006-03-07 17:32 ` iSteve
2006-03-07 21:47 ` Michael Buesch
2006-03-08  5:57 ` iSteve

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