fixes
authorMiklos Szeredi <miklos@szeredi.hu>
Fri, 22 Apr 2005 07:54:11 +0000 (07:54 +0000)
committerMiklos Szeredi <miklos@szeredi.hu>
Fri, 22 Apr 2005 07:54:11 +0000 (07:54 +0000)
ChangeLog
kernel/Makefile.in
kernel/file.c

index 4d83e658633ee05564ae793b9ae6a66dcb6bc7b2..94327f4f68f0badf160f91441db360597c7a713a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2005-04-22  Miklos Szeredi <miklos@szeredi.hu>
+
+       * Add -msoft-float to kernel module compile flags for 2.4.X.  This
+       is needed on certain architectures.  Report from Chris Kirby
+
+       * Fix buggy behavior of open(..., O_CREAT|O_EXCL) if interrupted.
+       Reported by David Shaw
+
 2005-04-08  Miklos Szeredi <miklos@szeredi.hu>
 
        * Fix Oops in case of nfs export.  Spotted by David Shaw
index 50dde76f8b40bc26c4c2b6834c6f147ab15f1f59..8bf108184bf7e5103e3ab3c6fbcecd412ae8bee1 100644 (file)
@@ -56,7 +56,7 @@ ifeq ($(majver), 2.4)
 
 CC = gcc
 LD = ld
-CFLAGS = -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -pipe 
+CFLAGS = -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -pipe -msoft-float
 CPPFLAGS = -I@kernelsrc@/include -I. -D__KERNEL__ -DMODULE -D_LOOSE_KERNEL_NAMES -DFUSE_VERSION=\"$(VERSION)\" @KERNELCPPFLAGS@
 
 fuse_objs = dev.o dir.o file.o inode.o compat/parser.o
index e7de38ae15fa1cdd99751817dce3f143290e631d..cf8e855af9b71cae33bbf9f118401d5f6ee2d67a 100644 (file)
@@ -24,6 +24,9 @@ int fuse_open_common(struct inode *inode, struct file *file, int isdir)
        struct fuse_open_out outarg;
        struct fuse_file *ff;
        int err;
+       /* Restarting the syscall is not allowed if O_CREAT and O_EXCL
+          are both set, because creation will fail on the restart */
+       int excl = (file->f_flags & (O_CREAT|O_EXCL)) == (O_CREAT|O_EXCL);
 
        err = generic_file_open(inode, file);
        if (err)
@@ -37,9 +40,12 @@ int fuse_open_common(struct inode *inode, struct file *file, int isdir)
                        return err;
        }
 
-       req = fuse_get_request(fc);
+       if (excl)
+               req = fuse_get_request_nonint(fc);
+       else
+               req = fuse_get_request(fc);
        if (!req)
-               return -ERESTARTSYS;
+               return excl ? -EINTR : -ERESTARTSYS;
 
        err = -ENOMEM;
        ff = kmalloc(sizeof(struct fuse_file), GFP_KERNEL);
@@ -63,7 +69,10 @@ int fuse_open_common(struct inode *inode, struct file *file, int isdir)
        req->out.numargs = 1;
        req->out.args[0].size = sizeof(outarg);
        req->out.args[0].value = &outarg;
-       request_send(fc, req);
+       if (excl)
+               request_send_nonint(fc, req);
+       else
+               request_send(fc, req);
        err = req->out.h.error;
        if (!err && !(fc->flags & FUSE_KERNEL_CACHE))
 #ifdef KERNEL_2_6