mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: <Andries.Brouwer@cwi.nl>
To: akpm@osdl.org, hirofumi@mail.parknet.co.jp, torvalds@osdl.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] fat/inode.c
Date: Fri, 2 Jul 2004 20:28:54 +0200 (MEST)	[thread overview]
Message-ID: <UTC200407021828.i62ISse29171.aeb@smtp.cwi.nl> (raw)

Two years ago, OGAWA Hirofumi removed some ugly code and
added a few simple tests to the FAT filesystem code,
intended to avoid recognizing non-FAT as FAT (for people who
fail to specify rootfstype=, forcing the kernel to guess).

That worked fairly well, until this year.
I have now seen a thread in Czech and a report from Holland
that involved the "FAT: bogus sectors-per-track value"
error message.

The patch below removes this test again. The advantage is that
some real-life FAT filesystems can be mounted again.
The disadvantage that more non-FAT fss will be accepted as FAT.

Ferry van Steen <freaky@bananateam.nl> reports
"the patch Andries Brouwer gave me seems to work".

Signed-off-by: Andries Brouwer <aeb@cwi.nl>

diff -uprN -X /linux/dontdiff a/fs/fat/inode.c b/fs/fat/inode.c
--- a/fs/fat/inode.c	2004-06-24 17:11:20
+++ b/fs/fat/inode.c	2004-07-02 19:25:21
@@ -830,18 +830,12 @@ int fat_fill_super(struct super_block *s
 		brelse(bh);
 		goto out_invalid;
 	}
-	if (!b->secs_track) {
-		if (!silent)
-			printk(KERN_ERR "FAT: bogus sectors-per-track value\n");
-		brelse(bh);
-		goto out_invalid;
-	}
-	if (!b->heads) {
-		if (!silent)
-			printk(KERN_ERR "FAT: bogus number-of-heads value\n");
-		brelse(bh);
-		goto out_invalid;
-	}
+
+	/*
+	 * Earlier we checked here that b->secs_track and b->head are nonzero,
+	 * but it turns out valid FAT filesystems can have zero there.
+	 */
+
 	media = b->media;
 	if (!FAT_VALID_MEDIA(media)) {
 		if (!silent)

             reply	other threads:[~2004-07-02 18:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-02 18:28 Andries.Brouwer [this message]
2004-07-03  4:22 ` OGAWA Hirofumi

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=UTC200407021828.i62ISse29171.aeb@smtp.cwi.nl \
    --to=andries.brouwer@cwi.nl \
    --cc=akpm@osdl.org \
    --cc=hirofumi@mail.parknet.co.jp \
    --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®