On Thu, Jan 18, 2007 at 04:15:00PM +0100, Dag-Erling Smrgrav wrote: > Didn't somebody mention ordering issues back then? Your revised patch > still doesn't even try to address those. If we ever get ext3 support, > for instance, mounting an ext2 file system as ext3 might cause it to > be silently upgraded to ext3. Since FreeBSD doesn't have any ext3 support right now, I think a more concrete example of ordering issues is to look at cd9660 vs. udf, which FreeBSD currently supports. In my patch, the mount_fs_try() function does deal with one ordering issue.....no matter what is in the vfs.conflist sysctl, it always tries to mount "ufs" first. This approximates the existing mount(8) behavior. It would not be hard to modify mount_fs_try() to deal with ordering of ext3 vs. ext2, udf vs. cd9660, or whatever. Not the most elegant solution, but workable for the limited subset of file systems that FreeBSD supports. > Not to mention the slew of error messages this will result in as you > walk the list of filesystems trying to find the right one... This is true, but in my tests, the "slew of error messages" is not too bad. Also, with my patch, if you specify the "-t" parameter, mount_fs_try() is not used, so things like mounting via /etc/fstab, where the fstype is specified, will behave the same way as now, and not iterate through a list of file systems. > A better way would be to have a userland utility attempt to identify > the file system, and if necessary load the appropriate module, before > mounting it. I disagree. To go down this road, instead of a separate utility, I think the best approach would be to put all this logic inside mount(8), the way Linux does, as Christoph Hellwig mentioned here: http://lists.freebsd.org/pipermail/freebsd-arch/2006-July/005447.html I've looked at the Linux mount utility source.....it maintains a table of magic numbers and offsets and tries them in a well defined order. The logic is quite involved, but it does work. The Linux code is under GPL though.... The other suggestion that someone had was to use libmagic in mount(8). libmagic is good, but using it in mount(8) would introduce link dependencies on libmagic and libz, and also introduce dependencies on files in /usr/share/misc/magic. -- Craig Rodrigues rodrigc_at_crodrigues.orgReceived on Fri Jan 19 2007 - 02:24:25 UTC
This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:04 UTC