From: iSteve <isteve@oneofthe.peoplewithissues.net>
To: linux-hotplug@vger.kernel.org
Subject: Libvolume incorrectly detects FAT32
Date: Mon, 06 Mar 2006 20:57:04 +0000 [thread overview]
Message-ID: <20060306215704.35f12840@silver> (raw)
[-- 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 */
next reply other threads:[~2006-03-06 20:57 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-06 20:57 iSteve [this message]
2006-03-06 21:59 ` Libvolume incorrectly detects FAT32 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
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=20060306215704.35f12840@silver \
--to=isteve@oneofthe.peoplewithissues.net \
--cc=linux-hotplug@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).