From mboxrd@z Thu Jan 1 00:00:00 1970 From: ebiederm@xmission.com (Eric W. Biederman) Subject: Re: [PATCH] Revert "__d_unalias() should refuse to move mountpoints" Date: Tue, 25 Sep 2012 04:29:58 -0700 Message-ID: <87sja6nxvt.fsf@xmission.com> References: <50609C43.1070702@canonical.com> <87txumrct6.fsf@xmission.com> <50615268.1040805@canonical.com> <8db34325-e8e4-4e24-85dd-c8951769e2b6@email.android.com> <506173A6.2050705@canonical.com> <87ipb2pemt.fsf@xmission.com> <50618F96.1020204@canonical.com> Mime-Version: 1.0 Content-Type: text/plain Cc: al viro , linux-fsdevel@vger.kernel.org, LKML To: Maarten Lankhorst Return-path: In-Reply-To: <50618F96.1020204@canonical.com> (Maarten Lankhorst's message of "Tue, 25 Sep 2012 13:03:50 +0200") Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org Maarten Lankhorst writes: >> Could you try the following patch? This should report what directories >> cannot be renamed because one of them is a mount point and it gives some >> real insight into what is going on. > > ls / > __d_unalias: /dev -> /dev > __d_unalias: /proc -> /proc > __d_unalias: /sys -> /sys Ok. That is what I thought was going on. For some reason nfs is attempting to recreate an existing dentry. Does this fix the nfs problem for you? Eric diff --git a/fs/dcache.c b/fs/dcache.c index 8086636..6390f0f 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -2404,6 +2404,9 @@ out_unalias: if (likely(!d_mountpoint(alias))) { __d_move(alias, dentry); ret = alias; + } else if ((alias->d_parent == dentry->d_parent) && + !dentry_cmp(alias, dentry->d_name.name, dentry->d_name.len)) + ret = alias; } out_err: spin_unlock(&inode->i_lock);