Commit 4919c5e4 authored by Al Viro's avatar Al Viro

fix race in d_splice_alias()

rehashing the negative placeholder opens a race with d_lookup();
we unhash it almost immediately (by d_move()), but the race
window is there.  Since d_move() doesn't rely on target being
hashed, we don't need that d_rehash() at all.
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent bec1052e
...@@ -1222,7 +1222,6 @@ struct dentry *d_splice_alias(struct inode *inode, struct dentry *dentry) ...@@ -1222,7 +1222,6 @@ struct dentry *d_splice_alias(struct inode *inode, struct dentry *dentry)
BUG_ON(!(new->d_flags & DCACHE_DISCONNECTED)); BUG_ON(!(new->d_flags & DCACHE_DISCONNECTED));
spin_unlock(&dcache_lock); spin_unlock(&dcache_lock);
security_d_instantiate(new, inode); security_d_instantiate(new, inode);
d_rehash(dentry);
d_move(new, dentry); d_move(new, dentry);
iput(inode); iput(inode);
} else { } else {
......
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