From: Miklos S. <mi...@sz...> - 2007-05-20 13:19:30
|
> issuing mknod() syscall to create a regular file on sshfs always return > EINVAL. it looks like mknod is being wrongly mapped onto create in > fuse_operations. > > I've experienced this with sshfs 1.8 and bot fuse 2.5.3 and 2.6.3 on linux > 2.6.20 Thanks, well spotted. This seems to be quite an old bug, present since 2.6.15, and manifesting in this behavior since 2.6.18. This patch should fix the issue. It's against the fuse module in the kernel tree, but it can be applied to the out-of-tree module as well by "cd fuse-2.6.3/kernel; patch -F3 < patch" Miklos Index: linux/fs/fuse/dir.c =================================================================== --- linux.orig/fs/fuse/dir.c 2007-05-18 20:10:39.000000000 +0200 +++ linux/fs/fuse/dir.c 2007-05-20 14:42:32.000000000 +0200 @@ -485,7 +485,7 @@ static int fuse_mknod(struct inode *dir, static int fuse_create(struct inode *dir, struct dentry *entry, int mode, struct nameidata *nd) { - if (nd && (nd->flags & LOOKUP_CREATE)) { + if (nd && (nd->flags & LOOKUP_OPEN)) { int err = fuse_create_open(dir, entry, mode, nd); if (err != -ENOSYS) return err; |