Re: -o union

From: Craig Rodrigues <rodrigc_at_crodrigues.org>
Date: Sat, 27 Oct 2007 16:37:04 -0400
On Thu, Oct 25, 2007 at 06:22:26PM +1000, Bruce Evans wrote:
> (1) It is broken for all file systems except ffs and ext2fs, since
>     all (?) file systems now use nmount(2) and only these two file
>     systems have "union" in their mount options list.  It is still in
>     the global options list in mount/mntopts.h, but this is only used
>     with mount(2).  The global options list in mount/mntopts.h has
>     many bogus non-global options, and even the global options list
>     in kern/vfs_mount.c has some bogus non-global options, but "union"
>     actually is a global options.  ext2fs loves "union" more than
>     ffs -- although its options list is less disordered than ffs's,
>     it has enough disorder to have 2 copies of "union".
> (2) After fixing (1) by not using nmount(2), following of symlinks works
>     strangely for at least devfs:


The long term path is to move to use nmount(2) in place of mount(2) everywhere.
Inside the kernel, when you call mount(2), you eventually call vfs_cmount
(if your file system implements vfs_cmount), which in turn eventually calls
vfs_donmount().  nmount(2) calls vfs_donmount() directly.

If "-o union" is a mount option that can apply to any file system
(even ones like procfs, tmpfs, unionfs, devfs), then we can add it
to global_opts in vfs_mount.c, so that it will be valid for any
file system.  If it does not make sense to do that, then we can add it to the
file systems where it works.

Right now, "-o union" is converted to MNT_UNION.....
I don't understand enough about MNT_UNION to judge if it is valid
for all file systems, or just UFS and EXT2FS.

When I converted the mount programs for UFS and EXT2FS to nmount(),
I noticed that the old mount(2) based mount programs for these file systems
 specifically allowed "-o union" for these two file systems, so I added
"union" to the local options array for these two file systems.

I don't understand enough about MNT_UNION to determine if it belongs
in global_opts or not.

-- 
Craig Rodrigues
rodrigc_at_crodrigues.org
Received on Sat Oct 27 2007 - 18:37:07 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:20 UTC