aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fuse/dir.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/fuse/dir.c')
-rw-r--r--fs/fuse/dir.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c
index 406bf61ed510..8890eba1db52 100644
--- a/fs/fuse/dir.c
+++ b/fs/fuse/dir.c
@@ -195,7 +195,7 @@ static struct dentry_operations fuse_dentry_operations = {
195 .d_revalidate = fuse_dentry_revalidate, 195 .d_revalidate = fuse_dentry_revalidate,
196}; 196};
197 197
198static int valid_mode(int m) 198int fuse_valid_type(int m)
199{ 199{
200 return S_ISREG(m) || S_ISDIR(m) || S_ISLNK(m) || S_ISCHR(m) || 200 return S_ISREG(m) || S_ISDIR(m) || S_ISLNK(m) || S_ISCHR(m) ||
201 S_ISBLK(m) || S_ISFIFO(m) || S_ISSOCK(m); 201 S_ISBLK(m) || S_ISFIFO(m) || S_ISSOCK(m);
@@ -248,7 +248,8 @@ static struct dentry *fuse_lookup(struct inode *dir, struct dentry *entry,
248 fuse_put_request(fc, req); 248 fuse_put_request(fc, req);
249 /* Zero nodeid is same as -ENOENT, but with valid timeout */ 249 /* Zero nodeid is same as -ENOENT, but with valid timeout */
250 if (!err && outarg.nodeid && 250 if (!err && outarg.nodeid &&
251 (invalid_nodeid(outarg.nodeid) || !valid_mode(outarg.attr.mode))) 251 (invalid_nodeid(outarg.nodeid) ||
252 !fuse_valid_type(outarg.attr.mode)))
252 err = -EIO; 253 err = -EIO;
253 if (!err && outarg.nodeid) { 254 if (!err && outarg.nodeid) {
254 inode = fuse_iget(dir->i_sb, outarg.nodeid, outarg.generation, 255 inode = fuse_iget(dir->i_sb, outarg.nodeid, outarg.generation,