From mboxrd@z Thu Jan 1 00:00:00 1970 From: Al Viro Subject: Re: [PATCH review 16/19] mnt: Track which mounts use a dentry as root. Date: Fri, 3 Apr 2015 06:54:50 +0100 Message-ID: <20150403055449.GE889@ZenIV.linux.org.uk> References: <87a8yqou41.fsf_-_@x220.int.ebiederm.org> <1428026183-14879-16-git-send-email-ebiederm@xmission.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1428026183-14879-16-git-send-email-ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: "Eric W. Biederman" Cc: Andrey Vagin , Richard Weinberger , Linux Containers , Andy Lutomirski , linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Jann Horn , Willy Tarreau List-Id: containers.vger.kernel.org On Thu, Apr 02, 2015 at 08:56:20PM -0500, Eric W. Biederman wrote: One general note - I'd probably put a pointer to that sucker into struct mount. For one thing, root-preserving clone_mnt() is a fairly common case. For another, searching for that thing in mnt_put_root() looks wrong. Matter of taste, but... Another thing is that IMO it's better to preallocate that thing in vfs_kern_mount() and free if it turns out to be unused. Simpler cleanup path that way... > - mnt->mnt.mnt_root = root; > + err = mnt_set_root(mnt, root); > + if (err) { > + dput(mnt->mnt.mnt_root); Unless I'm misreading your code, mnt_set_root() does *not* set it on failure, so what's going on here? > #define DCACHE_FALLTHRU 0x01000000 /* Fall through to lower layer */ ^^^^^^^^^^ > +#define DCACHE_MOUNTROOT 0x01000000 /* is root of a vfsmount */ ^^^^^^^^^^ Er...