summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHirofumi Ogawa <hirofumi@mail.parknet.co.jp>2004-10-19 18:16:56 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-10-19 18:16:56 -0700
commit5dfd31d1133be6b1c697c082900cc0e50d878639 (patch)
treec6df2c092af672827b38591f74db72397cbc6353
parent97a28b9a991f5eee548fca291911d4d7bdf868eb (diff)
[PATCH] FAT: remove validity check of FAT first entry
The low byte of FAT's first entry must have same value with media-field. So, I added that validity check for some case. In fact, in some case this check detected non-FAT filesystem. But in real world, unfortunately too many devices is writing a wrong value. This patch removes that validity check. Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--fs/fat/inode.c30
1 files changed, 8 insertions, 22 deletions
diff --git a/fs/fat/inode.c b/fs/fat/inode.c
index 3d345dd97b3c..a5ddd9c39f54 100644
--- a/fs/fat/inode.c
+++ b/fs/fat/inode.c
@@ -804,7 +804,7 @@ int fat_fill_super(struct super_block *sb, void *data, int silent,
struct msdos_sb_info *sbi;
u16 logical_sector_size;
u32 total_sectors, total_clusters, fat_clusters, rootdir_sectors;
- int debug, first;
+ int debug;
unsigned int media;
long error;
char buf[50];
@@ -1005,27 +1005,13 @@ int fat_fill_super(struct super_block *sb, void *data, int silent,
brelse(bh);
- /* validity check of FAT */
- first = __fat_access(sb, 0, -1);
- if (first < 0) {
- error = first;
- goto out_fail;
- }
- 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 (media == 0xf0 && FAT_FIRST_ENT(sb, 0xf8) == first) {
- /* bad, reported with a MO disk on win95/me */
- } 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;
- }
+ /*
+ * The low byte of FAT's first entry must have same value with
+ * media-field. But in real world, too many devices is
+ * writing wrong value. So, removed that validity check.
+ *
+ * if (FAT_FIRST_ENT(sb, media) != first)
+ */
error = -EINVAL;
sprintf(buf, "cp%d", sbi->options.codepage);