Skip to content

Commit

Permalink
move the call of __d_drop(anon) into __d_materialise_unique(dentry, a…
Browse files Browse the repository at this point in the history
…non)

commit 6f18493 upstream.

and lock the right list there

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Acked-by: NeilBrown <neilb@suse.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
  • Loading branch information
Al Viro authored and Jiri Slaby committed Jan 27, 2017
1 parent 77eed17 commit 75e8aab
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion fs/dcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -2623,6 +2623,12 @@ static void __d_materialise_dentry(struct dentry *dentry, struct dentry *anon)
dentry->d_parent = dentry;
list_del_init(&dentry->d_child);
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);

write_seqcount_end(&dentry->d_seq);
Expand Down Expand Up @@ -2677,7 +2683,6 @@ struct dentry *d_materialise_unique(struct dentry *dentry, struct inode *inode)
* could splice into our tree? */
__d_materialise_dentry(dentry, alias);
write_sequnlock(&rename_lock);
__d_drop(alias);
goto found;
} else {
/* Nope, but we must(!) avoid directory
Expand Down

0 comments on commit 75e8aab

Please sign in to comment.