diff options
Diffstat (limited to 'fs/fuse/dir.c')
-rw-r--r-- | fs/fuse/dir.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c index bb6829720dd6..5dfbb5439e4e 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c | |||
@@ -1272,10 +1272,19 @@ static int fuse_direntplus_link(struct file *file, | |||
1272 | if (!inode) | 1272 | if (!inode) |
1273 | goto out; | 1273 | goto out; |
1274 | 1274 | ||
1275 | alias = d_materialise_unique(dentry, inode); | 1275 | if (S_ISDIR(inode->i_mode)) { |
1276 | err = PTR_ERR(alias); | 1276 | mutex_lock(&fc->inst_mutex); |
1277 | if (IS_ERR(alias)) | 1277 | alias = fuse_d_add_directory(dentry, inode); |
1278 | goto out; | 1278 | mutex_unlock(&fc->inst_mutex); |
1279 | err = PTR_ERR(alias); | ||
1280 | if (IS_ERR(alias)) { | ||
1281 | iput(inode); | ||
1282 | goto out; | ||
1283 | } | ||
1284 | } else { | ||
1285 | alias = d_splice_alias(inode, dentry); | ||
1286 | } | ||
1287 | |||
1279 | if (alias) { | 1288 | if (alias) { |
1280 | dput(dentry); | 1289 | dput(dentry); |
1281 | dentry = alias; | 1290 | dentry = alias; |