cleanups
diff --git a/kernel/dir.c b/kernel/dir.c
index ce6df5d..a2fe6a8 100644
--- a/kernel/dir.c
+++ b/kernel/dir.c
@@ -73,12 +73,17 @@
inode->i_op = &fuse_symlink_inode_operations;
}
else if (S_ISCHR(inode->i_mode) || S_ISBLK(inode->i_mode) ||
- S_ISFIFO(inode->i_mode) || S_ISSOCK(inode->i_mode)){
+ S_ISFIFO(inode->i_mode) || S_ISSOCK(inode->i_mode)) {
inode->i_op = &fuse_file_inode_operations;
init_special_inode(inode, inode->i_mode,
new_decode_dev(attr->rdev));
- } else
+ } else {
+ /* Don't let user create weird files */
printk("fuse_init_inode: bad file type: %o\n", inode->i_mode);
+ inode->i_mode = S_IFREG;
+ inode->i_op = &fuse_file_inode_operations;
+ fuse_init_file_inode(inode);
+ }
}
#ifdef KERNEL_2_6
@@ -283,7 +288,7 @@
if ((inode->i_mode ^ mode) & S_IFMT) {
iput(inode);
printk("fuse_mknod: inode has wrong type\n");
- return -EINVAL;
+ return -EPROTO;
}
entry->d_time = time_to_jiffies(outarg->entry_valid,
@@ -609,7 +614,7 @@
/* FIXME: Need some mechanism to revoke permissions:
currently if the filesystem suddenly changes the
- file mode, we will not be informed abot that, and
+ file mode, we will not be informed about it, and
continue to allow access to the file/directory.
This is actually not so grave, since the user can
@@ -854,7 +859,6 @@
send_sig(SIGXFSZ, current, 0);
return -EFBIG;
}
- //fuse_sync_inode(inode);
}
req = fuse_get_request(fc);