Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 23 Feb 2007 07:46:32 +0100 (CET)
From:      "Tobias Roth" <ports@fsck.ch>
To:        freebsd-current@freebsd.org, freebsd-fs@freebsd.org
Subject:   Re: What does "mount -o union" and MNT_UNION really do?
Message-ID:  <1238.62.2.233.2.1172213192.squirrel@secure.socket.ch>
In-Reply-To: <20070222222301.GA13464@crodrigues.org>
References:  <20070222222301.GA13464@crodrigues.org>

next in thread | previous in thread | raw e-mail | index | archive | help
[resend, as I forgot to cc the lists and only replied to Craig]

On Thu, February 22, 2007 11:23 pm, Craig Rodrigues wrote:
> Hi,
>
> As part of recent cleanups and stability fixes in vfs_syscalls.c,
> Kostik Belousov removed the union_dircheckp() callback
> which the old unionfs implementation used, but the new one does not.
>
> Now I am looking at the mount code in vfs_mount.c, and
> am trying to figure out what the MNT_UNION flag
> is used for, which is set by doing "mount -o union".
> The following code in vfs_mount.c sets it:
>
>                else if (strcmp(opt->name, "union") == 0)
>                         fsflags |= MNT_UNION;
>
>
> However, the mount_unionfs binary never passes down "-o union",
> so the  MNT_UNION flag is never set if you do: "mount -t unionfs"
> or "mount_unionfs".
>
> The mount(8) man page documents it as:
>              union   Causes the namespace at the mount point to appear as
> the
>                      union of the mounted file system root and the
> existing
>                      directory.  Lookups will be done in the mounted file
> sys-
>                      tem first.  If those operations fail due to a
> non-exis-
>                      tent file the underlying directory is then accessed.
> All
>                      creates are done in the mounted file system.
>
>
> Is there a legitimate case where you would
> want to do "mount -o union", and have it behave differently
> from "mount_unionfs / mount -t unionfs"?  Or is this a leftover from
> a long time ago that we can now whack (it would simplify some code
> in the VFS layer if we whack it)?
>
> The MNT_UNION flag seemed to appear a long time ago:
>
> revision 1.120
> date: 1999/03/03 02:35:51;  author: julian;  state: Exp;  lines: +35 -33
> Slight cleanup of code resurected for union mounts..
> Submitted by: Tony Finch <dot@dotat.at>
> ----------------------------
> revision 1.119
> date: 1999/02/27 07:06:05;  author: julian;  state: Exp;  lines: +23 -1
> Fix code for union mounts
> Accidentally deleted by peter when he extracted the unionfs stuff in 1.109
>
> Submitted by: Tony Finch <dot@dotat.at>
> ----------------------------
> revision 1.109
> date: 1998/11/03 08:01:47;  author: peter;  state: Exp;  lines: +15 -114
> Change the #ifdef UNION code into a callable hook.  Arrange to have this
> set up when unionfs is present, either statically or as a kld module.
>
>
> --
> Craig Rodrigues
> rodrigc@crodrigues.org
> _______________________________________________
> freebsd-current@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
>





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