Commit dc2a6c2d authored by Miklos Szeredi's avatar Miklos Szeredi Committed by Greg Kroah-Hartman

fuse: readdirplus: fix instantiate

commit 2914941e upstream.

Fuse does instantiation slightly differently from NFS/CIFS which use
d_materialise_unique().
Signed-off-by: default avatarMiklos Szeredi <mszeredi@suse.cz>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 05ac7b3a
......@@ -1264,10 +1264,19 @@ static int fuse_direntplus_link(struct file *file,
if (!inode)
goto out;
alias = d_materialise_unique(dentry, inode);
err = PTR_ERR(alias);
if (IS_ERR(alias))
goto out;
if (S_ISDIR(inode->i_mode)) {
mutex_lock(&fc->inst_mutex);
alias = fuse_d_add_directory(dentry, inode);
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) {
dput(dentry);
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