Commit d6266c68 authored by Linus Torvalds's avatar Linus Torvalds

Make d_move() be able to gracefully handle the case of the dentry

already being unhashed on entry.
parent f8cef8c2
......@@ -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 */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment