From: ebiederm@xmission.com (Eric W. Biederman) Subject: Re: [PATCH 2/2] vfs: force reval on dentry of bind mounted files on FS_REVAL_DOT filesystems Date: Thu, 03 Dec 2009 03:56:41 -0800 Message-ID: References: <1259783983-26884-1-git-send-email-jlayton@redhat.com> <1259783983-26884-3-git-send-email-jlayton@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: jlayton@redhat.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, jamie@shareable.org, pavel@ucw.cz, viro@ZenIV.linux.org.uk, duaneg@dghda.com To: Miklos Szeredi Return-path: Received: from out02.mta.xmission.com ([166.70.13.232]:52915 "EHLO out02.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751953AbZLCL4m (ORCPT ); Thu, 3 Dec 2009 06:56:42 -0500 In-Reply-To: (Miklos Szeredi's message of "Thu\, 03 Dec 2009 12\:19\:48 +0100") Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Miklos Szeredi writes: > On Thu, 03 Dec 2009, Eric W. Biederman wrote: >> > The only worry I have is that this adds an extra branch in a very hot >> > codepath (do_lookup). An error can't be returned, as you note, and >> > for bind mounted directories d_invalidate() will not succeed: the >> > directory is busy, it's referenced by the mount. >> >> Not true. d_mountpoint is false, so d_invalidate can succeed. > > Have a look at the code. d_invalidate() doesn't check for a > mountpoint, it checks the refcount. It needs to keep the directory > dentry hashed if it's in any way reachable other than from the cache > (file descriptor, cwd, mount, etc). Ah. I thought you were thinking about the mandatory have_submounts() check in dentry->d_op->d_revalidate(). I expect the generic d_invalidate will simply hit the: spin_lock(&dcache_lock); if (d_unhashed(dentry)) { spin_unlock(&dcache_lock); return 0; } After the distributed filesystem has called d_drop in dentry->d_op->d_revalidate (when appropriate. Eric