Re: [PATCH] make cramfs look less hostile

Jörn Engel (joern@wohnheim.fh-wedel.de)
Mon, 16 Jun 2003 11:12:15 +0200


On Sun, 15 June 2003 23:49:09 +0200, Andries Brouwer wrote:
> On Sun, Jun 15, 2003 at 07:18:53PM +0100, Christoph Hellwig wrote:
> >
> > The only places where this should happen is mounting the rootfs.
> > mount(8) has it's own filesystem type detection code and doesn't
> > call mount(2) unless it found a matching filesystem type.
>
> Too optimistic a description.
> Any person who likes reliable results will give mount a -t option.
> If someone likes to gamble, and doesnt mind system crashes, he'll
> omit the -t and let mount guess what the type should have been.
> Mount has a battery of heuristics for a handful of filesystems.
> If any of these succeeds mount will try that type.
> If none succeeds, mount will try consecutively all types listed
> in /proc/filesystems for which no heuristic is present.

Actually, I have one example of reality matching Christoph's
description, so he wins this fight as well.

Patch below is trivial and does what I need. Any further complaints?

Jörn

-- 
With a PC, I always felt limited by the software available. On Unix, 
I am limited only by my knowledge.
-- Peter J. Schoenster

--- linux-2.5.71/fs/cramfs/inode.c~cramfs_message 2003-06-16 11:05:04.000000000 +0200 +++ linux-2.5.71/fs/cramfs/inode.c 2003-06-16 11:05:56.000000000 +0200 @@ -218,7 +218,8 @@ /* check at 512 byte offset */ memcpy(&super, cramfs_read(sb, 512, sizeof(super)), sizeof(super)); if (super.magic != CRAMFS_MAGIC) { - printk(KERN_ERR "cramfs: wrong magic\n"); + if (!silent) + printk(KERN_ERR "cramfs: wrong magic\n"); goto out; } } - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/