mirror of
https://github.com/torvalds/linux.git
synced 2024-11-23 04:31:50 +00:00
fuse: readdirplus: fix instantiate
Fuse does instantiation slightly differently from NFS/CIFS which use d_materialise_unique(). Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> CC: stable@vger.kernel.org
This commit is contained in:
parent
a28ef45cbb
commit
2914941e31
@ -1272,10 +1272,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;
|
||||
|
Loading…
Reference in New Issue
Block a user