From owner-freebsd-stable@FreeBSD.ORG Sat Oct 27 20:47:09 2007 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C027616A46C; Sat, 27 Oct 2007 20:47:09 +0000 (UTC) (envelope-from rodrigc@crodrigues.org) Received: from alnrmhc16.comcast.net (alnrmhc16.comcast.net [206.18.177.56]) by mx1.freebsd.org (Postfix) with ESMTP id 7806013C4A8; Sat, 27 Oct 2007 20:47:09 +0000 (UTC) (envelope-from rodrigc@crodrigues.org) Received: from _hostname_ (c-66-31-37-31.hsd1.ma.comcast.net[66.31.37.31]) by comcast.net (alnrmhc16) with SMTP id <20071027203705b160070bode>; Sat, 27 Oct 2007 20:37:06 +0000 Received: by _HOSTNAME_ (sSMTP sendmail emulation); Sat, 27 Oct 2007 16:37:04 -0400 From: "Craig Rodrigues" Date: Sat, 27 Oct 2007 16:37:04 -0400 To: Bruce Evans Message-ID: <20071027203704.GA63911@crodrigues.org> References: <200710241316.l9ODGYfZ093701@lurza.secnetix.de> <20071025180001.D87518@delplex.bde.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20071025180001.D87518@delplex.bde.org> User-Agent: Mutt/1.4.2.3i Cc: freebsd-fs@freebsd.org, freebsd-current@freebsd.org, freebsd-stable@freebsd.org, amdmi3@amdmi3.ru Subject: Re: -o union X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Oct 2007 20:47:09 -0000 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@crodrigues.org