aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@suse.cz>2007-05-23 16:57:32 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-23 23:14:11 -0400
commitb9ba347f27f2508e3da023688d047e111cbbe2da (patch)
tree5b683379c5c485a0fd1e22cbd16f62626b07d665 /fs
parentc12b3c62513ecf95c979d5c1785f99562b9dd10d (diff)
fuse: fix mknod of regular file
The wrong lookup flag was tested in ->create() causing havoc (error or Oops) when a regular file was created with mknod() in a fuse filesystem. Thanks to J. Cameijo Cerdeira for the report. Kernels 2.6.18 onward are affected. Please apply to -stable as well. Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> Cc: <stable@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/fuse/dir.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c
index 8890eba1db52..bd5a772d8ccf 100644
--- a/fs/fuse/dir.c
+++ b/fs/fuse/dir.c
@@ -485,7 +485,7 @@ static int fuse_mknod(struct inode *dir, struct dentry *entry, int mode,
485static int fuse_create(struct inode *dir, struct dentry *entry, int mode, 485static int fuse_create(struct inode *dir, struct dentry *entry, int mode,
486 struct nameidata *nd) 486 struct nameidata *nd)
487{ 487{
488 if (nd && (nd->flags & LOOKUP_CREATE)) { 488 if (nd && (nd->flags & LOOKUP_OPEN)) {
489 int err = fuse_create_open(dir, entry, mode, nd); 489 int err = fuse_create_open(dir, entry, mode, nd);
490 if (err != -ENOSYS) 490 if (err != -ENOSYS)
491 return err; 491 return err;