Commit 64df8d3b authored by Al Viro's avatar Al Viro Committed by Willy Tarreau

move the call of __d_drop(anon) into __d_materialise_unique(dentry, anon)

commit 6f18493e upstream.

and lock the right list there
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
Acked-by: default avatarNeilBrown <neilb@suse.com>
Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
Signed-off-by: default avatarWilly Tarreau <w@1wt.eu>
parent dda50d92
...@@ -2405,6 +2405,12 @@ static void __d_materialise_dentry(struct dentry *dentry, struct dentry *anon) ...@@ -2405,6 +2405,12 @@ static void __d_materialise_dentry(struct dentry *dentry, struct dentry *anon)
dentry->d_parent = dentry; dentry->d_parent = dentry;
list_del_init(&dentry->d_child); list_del_init(&dentry->d_child);
anon->d_parent = dparent; anon->d_parent = dparent;
if (likely(!d_unhashed(anon))) {
hlist_bl_lock(&anon->d_sb->s_anon);
__hlist_bl_del(&anon->d_hash);
anon->d_hash.pprev = NULL;
hlist_bl_unlock(&anon->d_sb->s_anon);
}
list_move(&anon->d_child, &dparent->d_subdirs); list_move(&anon->d_child, &dparent->d_subdirs);
write_seqcount_end(&dentry->d_seq); write_seqcount_end(&dentry->d_seq);
...@@ -2459,7 +2465,6 @@ struct dentry *d_materialise_unique(struct dentry *dentry, struct inode *inode) ...@@ -2459,7 +2465,6 @@ struct dentry *d_materialise_unique(struct dentry *dentry, struct inode *inode)
* could splice into our tree? */ * could splice into our tree? */
__d_materialise_dentry(dentry, alias); __d_materialise_dentry(dentry, alias);
write_sequnlock(&rename_lock); write_sequnlock(&rename_lock);
__d_drop(alias);
goto found; goto found;
} else { } else {
/* Nope, but we must(!) avoid directory /* Nope, but we must(!) avoid directory
......
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