From mboxrd@z Thu Jan 1 00:00:00 1970 From: Al Viro Subject: Re: [PATCH] vfs: Fix, simpliy and stop using d_dname for the /proc/*/ns/* files. Date: Thu, 21 May 2015 00:23:25 +0100 Message-ID: <20150520232325.GA7232@ZenIV.linux.org.uk> References: <20150515185820.GQ20468@ycc.fr> <20150520100557.GB32189@mew> <87bnhedhw5.fsf_-_@x220.int.ebiederm.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Omar Sandoval , Ivan Delalande , linux-fsdevel@vger.kernel.org To: "Eric W. Biederman" Return-path: Received: from zeniv.linux.org.uk ([195.92.253.2]:34932 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753053AbbETXXu (ORCPT ); Wed, 20 May 2015 19:23:50 -0400 Content-Disposition: inline In-Reply-To: <87bnhedhw5.fsf_-_@x220.int.ebiederm.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Wed, May 20, 2015 at 05:05:30PM -0500, Eric W. Biederman wrote: > - dentry = d_alloc_pseudo(mnt->mnt_sb, &qname); > + dentry = d_alloc_name(mnt->mnt_root, name); > if (!dentry) { > iput(inode); > mntput(mnt); > return ERR_PTR(-ENOMEM); > } > - d_instantiate(dentry, inode); > + d_add(dentry, inode); Careful - that might have non-trivial effects. Namely, you are making the root dentry of that sucker a contention point and adding to hash pollution... It's probably not going to cause visible problems, but it's worth profiling just to be sure. Besides, you are violating a bunch of rules here - several hashed children of the same directory with the same name all at once... not nice.