]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
[PATCH] fuse: fix mknod of regular file
authorMiklos Szeredi <mszeredi@suse.cz>
Mon, 21 May 2007 09:39:58 +0000 (11:39 +0200)
committerChris Wright <chrisw@sous-sol.org>
Mon, 11 Jun 2007 18:37:10 +0000 (11:37 -0700)
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>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/fuse/dir.c

index 40080477ceb4fa5a2fed48f0da0c446c10614bb5..942069b823328aa4e1f4f5c7434876da059845da 100644 (file)
@@ -484,7 +484,7 @@ static int fuse_mknod(struct inode *dir, struct dentry *entry, int mode,
 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;