]> git.hungrycats.org Git - linux/commitdiff
Make d_move() be able to gracefully handle the case of the dentry
authorLinus Torvalds <torvalds@home.transmeta.com>
Thu, 12 Jun 2003 03:00:54 +0000 (20:00 -0700)
committerLinus Torvalds <torvalds@home.transmeta.com>
Thu, 12 Jun 2003 03:00:54 +0000 (20:00 -0700)
already being unhashed on entry.

fs/dcache.c

index 49589ad42441aa9ebd9d79b97a8c023c49e1c3f5..210f8d1fb65fd02966411e0fca8ad0c8066644ce 100644 (file)
@@ -1221,10 +1221,14 @@ void d_move(struct dentry * dentry, struct dentry * target)
        }
 
        /* Move the dentry to the target hash queue, if on different bucket */
+       if (dentry->d_vfs_flags & DCACHE_UNHASHED)
+               goto already_unhashed;
        if (dentry->d_bucket != target->d_bucket) {
-               dentry->d_bucket = target->d_bucket;
                hlist_del_rcu(&dentry->d_hash);
+already_unhashed:
+               dentry->d_bucket = target->d_bucket;
                hlist_add_head_rcu(&dentry->d_hash, target->d_bucket);
+               dentry->d_vfs_flags &= ~DCACHE_UNHASHED;
        }
 
        /* Unhash the target: dput() will then get rid of it */