mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] fat/inode.c
@ 2004-07-02 18:28 Andries.Brouwer
  2004-07-03  4:22 ` OGAWA Hirofumi
  0 siblings, 1 reply; 2+ messages in thread
From: Andries.Brouwer @ 2004-07-02 18:28 UTC (permalink / raw)
  To: akpm, hirofumi, torvalds; +Cc: linux-kernel

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)

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

* Re: [PATCH] fat/inode.c
  2004-07-02 18:28 [PATCH] fat/inode.c Andries.Brouwer
@ 2004-07-03  4:22 ` OGAWA Hirofumi
  0 siblings, 0 replies; 2+ messages in thread
From: OGAWA Hirofumi @ 2004-07-03  4:22 UTC (permalink / raw)
  To: Andries.Brouwer; +Cc: akpm, torvalds, linux-kernel

<Andries.Brouwer@cwi.nl> writes:

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

Yes.

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

Sounds good. Please apply.
-- 
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

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

end of thread, other threads:[~2004-07-03  4:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-02 18:28 [PATCH] fat/inode.c Andries.Brouwer
2004-07-03  4:22 ` OGAWA Hirofumi

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®