From owner-freebsd-fs@FreeBSD.ORG Fri Feb 23 07:21:48 2007 Return-Path: X-Original-To: freebsd-fs@freebsd.org Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2BDFB16A403; Fri, 23 Feb 2007 07:21:48 +0000 (UTC) (envelope-from ports@fsck.ch) Received: from secure.socket.ch (secure.socket.ch [212.103.70.36]) by mx1.freebsd.org (Postfix) with ESMTP id BB12313C48E; Fri, 23 Feb 2007 07:21:47 +0000 (UTC) (envelope-from ports@fsck.ch) Received: from localhost ([127.0.0.1] helo=secure.socket.ch) by secure.socket.ch with esmtp (Exim 4.66 (FreeBSD)) (envelope-from ) id 1HKUCO-000KNu-T4; Fri, 23 Feb 2007 07:46:36 +0100 Received: from 62.2.233.2 (SquirrelMail authenticated user roth@fsck.ch) by secure.socket.ch with HTTP; Fri, 23 Feb 2007 07:46:32 +0100 (CET) Message-ID: <1238.62.2.233.2.1172213192.squirrel@secure.socket.ch> In-Reply-To: <20070222222301.GA13464@crodrigues.org> References: <20070222222301.GA13464@crodrigues.org> Date: Fri, 23 Feb 2007 07:46:32 +0100 (CET) From: "Tobias Roth" To: freebsd-current@freebsd.org, freebsd-fs@freebsd.org User-Agent: SquirrelMail/1.4.9a MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-Spam-Score: -3.8 (---) X-Spam-Report: Spam detection software, running on the system "secure.socket.ch", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see The administrator of that system for details. Content preview: [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 > > 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 > > revision 1.109 > date: 1998/11/03 08:01:47; author: peter; state: Exp; lines: +15 -114 > Change the #ifdef UNION code [...] Content analysis details: (-3.8 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.8 ALL_TRUSTED Passed through trusted hosts only via SMTP -2.6 BAYES_00 BODY: Bayesian spam probability is 0 to 1% [score: 0.0000] 0.6 AWL AWL: From: address is in the auto white-list X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: ports@fsck.ch X-SA-Exim-Scanned: No (on secure.socket.ch); SAEximRunCond expanded to false Cc: Subject: Re: What does "mount -o union" and MNT_UNION really do? X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Feb 2007 07:21:48 -0000 [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 > ---------------------------- > 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 > ---------------------------- > 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" >