]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - fs/dcache.c
VFS: Fix the nfs sillyrename regression in kernel 2.6.38
[mv-sheeva.git] / fs / dcache.c
index 361882a14ccbce8885ca2759c6d9d2db2b419804..a39fe47c466f794cb4f794ccd2863f2e165fc03e 100644 (file)
@@ -296,8 +296,12 @@ static struct dentry *d_kill(struct dentry *dentry, struct dentry *parent)
        __releases(parent->d_lock)
        __releases(dentry->d_inode->i_lock)
 {
-       dentry->d_parent = NULL;
        list_del(&dentry->d_u.d_child);
+       /*
+        * Inform try_to_ascend() that we are no longer attached to the
+        * dentry tree
+        */
+       dentry->d_flags |= DCACHE_DISCONNECTED;
        if (parent)
                spin_unlock(&parent->d_lock);
        dentry_iput(dentry);
@@ -1030,6 +1034,7 @@ static struct dentry *try_to_ascend(struct dentry *old, int locked, unsigned seq
         * or deletion
         */
        if (new != old->d_parent ||
+                (old->d_flags & DCACHE_DISCONNECTED) ||
                 (!locked && read_seqretry(&rename_lock, seq))) {
                spin_unlock(&new->d_lock);
                new = NULL;