From mboxrd@z Thu Jan 1 00:00:00 1970 From: Al Viro Subject: Re: [PATCH 1/4] VFS: Add a VFS helper function vfs_remote_path_lookup() Date: Thu, 2 Apr 2009 20:52:12 +0100 Message-ID: <20090402195212.GK28946@ZenIV.linux.org.uk> References: <3f1264127d431f695be25b940b477e3d287edc68.1238525532.git.Trond.Myklebust@netapp.com> <20090401021554.GV28946@ZenIV.linux.org.uk> <1238616394.24360.2.camel@heimdal.trondhjem.org> <20090401202629.GG28946@ZenIV.linux.org.uk> <1238628133.24360.51.camel@heimdal.trondhjem.org> <20090401233252.GH28946@ZenIV.linux.org.uk> <1238629407.19782.5.camel@heimdal.trondhjem.org> <20090402191709.GJ28946@ZenIV.linux.org.uk> <1238700874.16087.42.camel@heimdal.trondhjem.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Linus Torvalds , linux-fsdevel@vger.kernel.org To: Trond Myklebust Return-path: Received: from zeniv.linux.org.uk ([195.92.253.2]:57441 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755591AbZDBTwR (ORCPT ); Thu, 2 Apr 2009 15:52:17 -0400 Content-Disposition: inline In-Reply-To: <1238700874.16087.42.camel@heimdal.trondhjem.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Thu, Apr 02, 2009 at 03:34:34PM -0400, Trond Myklebust wrote: > > *OW* > > > > I've missed that completely. OK, may I see the users, please? > > This is why I'm reluctant to call it unshare_mnt_namespace() and was why > I was trying to limit the usage of the interface. Ho-hum... You know what, it *still* fits into unshare() model. The thing is, if you look at the origin of clone()/unshare() (i.e. Plan 9 rfork()), there's the following group of flags: RFNAMEG If set, the new process inherits a copy of the parent's name space; otherwise the new process shares the parent's name space. Is mutually exclusive with RFCNAMEG. RFCNAMEG If set, the new process starts with a clean name space. A new name space must be built from a mount of an open file descriptor. Is mutually exclusive with RFNAMEG. RFNOMNT If set, subsequent mounts into the new name space and dereferencing of pathnames starting with # are disallowed. And analog of that sucker (RFCNAMEG) is just about what you are doing (well, that + attaching your vfsmount as separate action). So how about about CLONE_CLEANNS and passing it in flags? Linus, do you have any objections against such a flag? It'd give you a new instance of rootfs (empty, obviously) as root and flip root/pwd to it. The thing is, I really want it to make sense other than just a very specialized wrapper around path lookup. We *already* have a bunch of places doing subsets of unshare()-and-save; would be nice to get it right once and for all... BTW, if we look into the original, there's also RFCFDG - "give it an empty descriptor table". Might be also interesting, but that's a separate story.