Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Jul 2006 12:45:18 +0100 (BST)
From:      Robert Watson <rwatson@FreeBSD.org>
To:        Christoph Hellwig <hch@infradead.org>
Cc:        Craig Rodrigues <rodrigc@crodrigues.org>, Scott Long <scottl@samsco.org>, freebsd-current@freebsd.org, freebsd-arch@freebsd.org
Subject:   Re: [RFC] mount can figure out fstype automatically
Message-ID:  <20060711124356.Y78628@fledge.watson.org>
In-Reply-To: <20060710202219.GA29786@infradead.org>
References:  <20060708152801.GA3671@crodrigues.org> <44AFD7DF.8090002@errno.com> <20060708174606.GA29602@infradead.org> <44B2A51A.4040103@samsco.org> <20060710202219.GA29786@infradead.org>

next in thread | previous in thread | raw e-mail | index | archive | help

On Mon, 10 Jul 2006, Christoph Hellwig wrote:

> On Mon, Jul 10, 2006 at 01:06:02PM -0600, Scott Long wrote:
>> So in your opinion and experience, what are the pros and cons of 
>> maintaining a table of magic numbers?
>
> The feature is imensely useful.  The implementation won't win any points for 
> a clean design but works very well in practice.  I think it's definitly 
> better than probing in the kernel because letting a filesystem driver try to 
> make sense of something that's not it's own format can lead to all kinds of 
> funnies.  Linux does this (iterating all filesystem types in kernel) for the 
> special case of the root filesystem where mount(8) is not available, and it 
> showeds various interesting bugs at least in the fat driver.

In both FreeBSD and Darwin, I've noticed that the kernel msdosfs code is 
excessively permissive as to what it considers a FAT file system.  This is 
presumably necessary due to the enourmous diversity of FAT file systems 
floating around, but it makes it a little too easy to cause msdos to trip over 
layouts that violate its layout assumptions. :-)  FAT is much more reliably 
detected by looking at the partition type it lives in than by looking at the 
bytes that appear inside the partition, I believe.

Robert N M Watson
Computer Laboratory
University of Cambridge



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060711124356.Y78628>