Commit 2914941e authored by Miklos Szeredi's avatar Miklos Szeredi

fuse: readdirplus: fix instantiate

Fuse does instantiation slightly differently from NFS/CIFS which use
d_materialise_unique().
Signed-off-by: default avatarMiklos Szeredi <mszeredi@suse.cz>
CC: stable@vger.kernel.org
parent a28ef45c
...@@ -1272,10 +1272,19 @@ static int fuse_direntplus_link(struct file *file, ...@@ -1272,10 +1272,19 @@ static int fuse_direntplus_link(struct file *file,
if (!inode) if (!inode)
goto out; goto out;
alias = d_materialise_unique(dentry, inode); if (S_ISDIR(inode->i_mode)) {
err = PTR_ERR(alias); mutex_lock(&fc->inst_mutex);
if (IS_ERR(alias)) alias = fuse_d_add_directory(dentry, inode);
goto out; mutex_unlock(&fc->inst_mutex);
err = PTR_ERR(alias);
if (IS_ERR(alias)) {
iput(inode);
goto out;
}
} else {
alias = d_splice_alias(inode, dentry);
}
if (alias) { if (alias) {
dput(dentry); dput(dentry);
dentry = alias; dentry = alias;
......
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