@@ -2656,6 +2656,12 @@ static void __d_materialise_dentry(struct dentry *dentry, struct dentry *anon)
2656
2656
dentry -> d_parent = dentry ;
2657
2657
list_del_init (& dentry -> d_u .d_child );
2658
2658
anon -> d_parent = dparent ;
2659
+ if (likely (!d_unhashed (anon ))) {
2660
+ hlist_bl_lock (& anon -> d_sb -> s_anon );
2661
+ __hlist_bl_del (& anon -> d_hash );
2662
+ anon -> d_hash .pprev = NULL ;
2663
+ hlist_bl_unlock (& anon -> d_sb -> s_anon );
2664
+ }
2659
2665
list_move (& anon -> d_u .d_child , & dparent -> d_subdirs );
2660
2666
2661
2667
write_seqcount_end (& dentry -> d_seq );
@@ -2714,7 +2720,6 @@ struct dentry *d_splice_alias(struct inode *inode, struct dentry *dentry)
2714
2720
write_seqlock (& rename_lock );
2715
2721
__d_materialise_dentry (dentry , new );
2716
2722
write_sequnlock (& rename_lock );
2717
- __d_drop (new );
2718
2723
_d_rehash (new );
2719
2724
spin_unlock (& new -> d_lock );
2720
2725
spin_unlock (& inode -> i_lock );
@@ -2778,7 +2783,6 @@ struct dentry *d_materialise_unique(struct dentry *dentry, struct inode *inode)
2778
2783
* could splice into our tree? */
2779
2784
__d_materialise_dentry (dentry , alias );
2780
2785
write_sequnlock (& rename_lock );
2781
- __d_drop (alias );
2782
2786
goto found ;
2783
2787
} else {
2784
2788
/* Nope, but we must(!) avoid directory
0 commit comments