Commit f12ec440 authored by Miklos Szeredi's avatar Miklos Szeredi Committed by Linus Torvalds

[PATCH] fuse: clean up dead code related to nfs exporting

Remove last remains of NFS exportability support.

The code is actually buggy (as reported by Akshat Aranya), since 'alias'
will be leaked if it's non-null and alias->d_flags has DCACHE_DISCONNECTED.

This is not an active bug, since there will never be any disconnected
dentries.  But it's better to get rid of the unnecessary complexity anyway.
Signed-off-by: default avatarMiklos Szeredi <miklos@szeredi.hu>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 15d2bace
...@@ -741,13 +741,14 @@ static struct dentry *fuse_lookup(struct inode *dir, struct dentry *entry, ...@@ -741,13 +741,14 @@ static struct dentry *fuse_lookup(struct inode *dir, struct dentry *entry,
if (inode && S_ISDIR(inode->i_mode)) { if (inode && S_ISDIR(inode->i_mode)) {
/* Don't allow creating an alias to a directory */ /* Don't allow creating an alias to a directory */
struct dentry *alias = d_find_alias(inode); struct dentry *alias = d_find_alias(inode);
if (alias && !(alias->d_flags & DCACHE_DISCONNECTED)) { if (alias) {
dput(alias); dput(alias);
iput(inode); iput(inode);
return ERR_PTR(-EIO); return ERR_PTR(-EIO);
} }
} }
return d_splice_alias(inode, entry); d_add(entry, inode);
return NULL;
} }
static int fuse_setxattr(struct dentry *entry, const char *name, static int fuse_setxattr(struct dentry *entry, const char *name,
......
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