aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/btrfs/inode.c2
-rw-r--r--fs/btrfs/super.c9
2 files changed, 9 insertions, 2 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 1af34d0c744b..4ffb6d79f9f0 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -5150,7 +5150,7 @@ static struct dentry *btrfs_lookup(struct inode *dir, struct dentry *dentry,
5150 return ERR_CAST(inode); 5150 return ERR_CAST(inode);
5151 } 5151 }
5152 5152
5153 return d_splice_alias(inode, dentry); 5153 return d_materialise_unique(dentry, inode);
5154} 5154}
5155 5155
5156unsigned char btrfs_filetype_table[] = { 5156unsigned char btrfs_filetype_table[] = {
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index e73c80eec11b..d04db817be5c 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -855,6 +855,7 @@ static struct dentry *get_default_root(struct super_block *sb,
855 struct btrfs_path *path; 855 struct btrfs_path *path;
856 struct btrfs_key location; 856 struct btrfs_key location;
857 struct inode *inode; 857 struct inode *inode;
858 struct dentry *dentry;
858 u64 dir_id; 859 u64 dir_id;
859 int new = 0; 860 int new = 0;
860 861
@@ -925,7 +926,13 @@ setup_root:
925 return dget(sb->s_root); 926 return dget(sb->s_root);
926 } 927 }
927 928
928 return d_obtain_alias(inode); 929 dentry = d_obtain_alias(inode);
930 if (!IS_ERR(dentry)) {
931 spin_lock(&dentry->d_lock);
932 dentry->d_flags &= ~DCACHE_DISCONNECTED;
933 spin_unlock(&dentry->d_lock);
934 }
935 return dentry;
929} 936}
930 937
931static int btrfs_fill_super(struct super_block *sb, 938static int btrfs_fill_super(struct super_block *sb,