diff options
-rw-r--r-- | fs/dcache.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/fs/dcache.c b/fs/dcache.c index 7a5b51440afa..36d84ec31d8a 100644 --- a/fs/dcache.c +++ b/fs/dcache.c | |||
@@ -2636,7 +2636,6 @@ out_err: | |||
2636 | /* | 2636 | /* |
2637 | * Prepare an anonymous dentry for life in the superblock's dentry tree as a | 2637 | * Prepare an anonymous dentry for life in the superblock's dentry tree as a |
2638 | * named dentry in place of the dentry to be replaced. | 2638 | * named dentry in place of the dentry to be replaced. |
2639 | * returns with anon->d_lock held! | ||
2640 | */ | 2639 | */ |
2641 | static void __d_materialise_dentry(struct dentry *dentry, struct dentry *anon) | 2640 | static void __d_materialise_dentry(struct dentry *dentry, struct dentry *anon) |
2642 | { | 2641 | { |
@@ -2655,21 +2654,21 @@ static void __d_materialise_dentry(struct dentry *dentry, struct dentry *anon) | |||
2655 | dentry->d_parent = dentry; | 2654 | dentry->d_parent = dentry; |
2656 | list_del_init(&dentry->d_u.d_child); | 2655 | list_del_init(&dentry->d_u.d_child); |
2657 | anon->d_parent = dparent; | 2656 | anon->d_parent = dparent; |
2657 | list_move(&anon->d_u.d_child, &dparent->d_subdirs); | ||
2658 | if (likely(!d_unhashed(anon))) { | 2658 | if (likely(!d_unhashed(anon))) { |
2659 | hlist_bl_lock(&anon->d_sb->s_anon); | 2659 | hlist_bl_lock(&anon->d_sb->s_anon); |
2660 | __hlist_bl_del(&anon->d_hash); | 2660 | __hlist_bl_del(&anon->d_hash); |
2661 | anon->d_hash.pprev = NULL; | 2661 | anon->d_hash.pprev = NULL; |
2662 | hlist_bl_unlock(&anon->d_sb->s_anon); | 2662 | hlist_bl_unlock(&anon->d_sb->s_anon); |
2663 | } | 2663 | } |
2664 | list_move(&anon->d_u.d_child, &dparent->d_subdirs); | 2664 | __d_rehash(anon, d_hash(anon->d_parent, anon->d_name.hash)); |
2665 | 2665 | ||
2666 | write_seqcount_end(&dentry->d_seq); | 2666 | write_seqcount_end(&dentry->d_seq); |
2667 | write_seqcount_end(&anon->d_seq); | 2667 | write_seqcount_end(&anon->d_seq); |
2668 | 2668 | ||
2669 | dentry_unlock_parents_for_move(anon, dentry); | 2669 | dentry_unlock_parents_for_move(anon, dentry); |
2670 | spin_unlock(&dentry->d_lock); | 2670 | spin_unlock(&dentry->d_lock); |
2671 | 2671 | spin_unlock(&anon->d_lock); | |
2672 | /* anon->d_lock still locked, returns locked */ | ||
2673 | } | 2672 | } |
2674 | 2673 | ||
2675 | /** | 2674 | /** |
@@ -2719,8 +2718,6 @@ struct dentry *d_splice_alias(struct inode *inode, struct dentry *dentry) | |||
2719 | write_seqlock(&rename_lock); | 2718 | write_seqlock(&rename_lock); |
2720 | __d_materialise_dentry(dentry, new); | 2719 | __d_materialise_dentry(dentry, new); |
2721 | write_sequnlock(&rename_lock); | 2720 | write_sequnlock(&rename_lock); |
2722 | _d_rehash(new); | ||
2723 | spin_unlock(&new->d_lock); | ||
2724 | spin_unlock(&inode->i_lock); | 2721 | spin_unlock(&inode->i_lock); |
2725 | security_d_instantiate(new, inode); | 2722 | security_d_instantiate(new, inode); |
2726 | iput(inode); | 2723 | iput(inode); |
@@ -2811,9 +2808,9 @@ struct dentry *d_materialise_unique(struct dentry *dentry, struct inode *inode) | |||
2811 | BUG_ON(!d_unhashed(actual)); | 2808 | BUG_ON(!d_unhashed(actual)); |
2812 | 2809 | ||
2813 | spin_lock(&actual->d_lock); | 2810 | spin_lock(&actual->d_lock); |
2814 | found: | ||
2815 | _d_rehash(actual); | 2811 | _d_rehash(actual); |
2816 | spin_unlock(&actual->d_lock); | 2812 | spin_unlock(&actual->d_lock); |
2813 | found: | ||
2817 | spin_unlock(&inode->i_lock); | 2814 | spin_unlock(&inode->i_lock); |
2818 | out_nolock: | 2815 | out_nolock: |
2819 | if (actual == dentry) { | 2816 | if (actual == dentry) { |