merge up to fuse_2_6_merge1
authorMiklos Szeredi <miklos@szeredi.hu>
Fri, 19 Jan 2007 22:11:40 +0000 (22:11 +0000)
committerMiklos Szeredi <miklos@szeredi.hu>
Fri, 19 Jan 2007 22:11:40 +0000 (22:11 +0000)
ChangeLog
kernel/file.c
kernel/fuse_i.h
lib/fuse.c
lib/mount.c
lib/ulockmgr.c
util/fusermount.c
util/ulockmgr_server.c

index 350e5750ccde4ce21ec2e09b30313ce0d643a7ad..37c54d66978737b046c2ce26b65ca7416f962873 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,11 +1,35 @@
-2006-01-13  Miklos Szeredi <miklos@szeredi.hu>
+2007-01-19  Miklos Szeredi <miklos@szeredi.hu>
+
+       * Build fix for 2.6.16 vanila and 2.6.15 FC5 kernels.  Patch from
+       Ian Abbott
+
+2007-01-18  Miklos Szeredi <miklos@szeredi.hu>
+
+       * Fix abort in fuse_new() compatibility API for opts == NULL case.
+       Novell bugzilla #233870.  Patch from Takashi Iwai.
+
+2007-01-13  Miklos Szeredi <miklos@szeredi.hu>
 
        * Fix option parsing in mount.fuse.  Patch from Jens M. Noedler
 
+2007-01-02  Miklos Szeredi <miklos@szeredi.hu>
+
+       * Fix unaligned access in file desctriptor passing in libfuse,
+       fusermount and ulockmgr.  Debian bug ID: 404904.  Reported and
+       tested by Sebastian Fontius
+
 2006-12-16  Miklos Szeredi <miklos@szeredi.hu>
 
        * kernel: don't keep unreferenced inodes in the icache.
 
+2006-12-15  Miklos Szeredi <miklos@szeredi.hu>
+
+       * fusermount: Fix detection of fuseblk.  Reported by Szakacsits
+       Szabolcs
+
+       * lib: Fix use after free in fuse_flush().  Reported by Ron
+       Lindman
+
 2006-12-10  Miklos Szeredi <miklos@szeredi.hu>
 
        * mount.fuse: add "setuid=USER" option which does a "su - USER"
index 6cf71f3134ff3f175fb2a8248d60655ee903f901..3006d02b02fb218901e0ca923bf65b21445af46f 100644 (file)
@@ -628,15 +628,9 @@ static ssize_t fuse_direct_write(struct file *file, const char __user *buf,
        struct inode *inode = file->f_dentry->d_inode;
        ssize_t res;
        /* Don't allow parallel writes to the same file */
-#ifdef KERNEL_2_6_16_PLUS
        mutex_lock(&inode->i_mutex);
        res = fuse_direct_io(file, buf, count, ppos, 1);
        mutex_unlock(&inode->i_mutex);
-#else
-       down(&inode->i_sem);
-       res = fuse_direct_io(file, buf, count, ppos, 1);
-       up(&inode->i_sem);
-#endif
        return res;
 }
 
index f5b26f24da990e85c0ca35709e8c8581e6e37573..5259ee10c27721fceb362beb977d39b69498d7eb 100644 (file)
 #include <linux/spinlock.h>
 #include <linux/mm.h>
 #include <linux/backing-dev.h>
-#ifdef KERNEL_2_6_17_PLUS
-#include <linux/mutex.h>
-#else
-#include <asm/semaphore.h>
+#ifndef DEFINE_MUTEX
 #define DEFINE_MUTEX(m) DECLARE_MUTEX(m)
 #define mutex_init(m) init_MUTEX(m)
 #define mutex_destroy(m) do { } while (0)
 #define mutex_lock(m) down(m)
 #define mutex_unlock(m) up(m)
 #define mutex semaphore
+#define i_mutex i_sem  /* Hack for struct inode */
 #endif
 #ifndef KERNEL_2_6_19_PLUS
 #define clear_nlink(inode) (inode)->i_nlink = 0
index 4446245096dc44935a05ff4dad56baee912a84b2..994a31f773dc341f4693f5e23b1f6e8a8fccfb05 100644 (file)
@@ -2295,7 +2295,6 @@ static void fuse_flush(fuse_req_t req, fuse_ino_t ino,
         err = -ENOSYS;
         if (f->op.flush)
             err = fuse_do_flush(f, req, path, fi);
-        free(path);
     }
     if (f->op.lock) {
         struct flock lock;
@@ -2314,6 +2313,7 @@ static void fuse_flush(fuse_req_t req, fuse_ino_t ino,
         if (err == -ENOSYS)
             err = 0;
     }
+    free(path);
     pthread_rwlock_unlock(&f->tree_lock);
     reply_err(req, err);
 }
@@ -2948,9 +2948,10 @@ static struct fuse *fuse_new_common_compat(int fd, const char *opts,
     struct fuse *f;
     struct fuse_args args = FUSE_ARGS_INIT(0, NULL);
 
+    if (fuse_opt_add_arg(&args, "") == -1)
+       return NULL;
     if (opts &&
-        (fuse_opt_add_arg(&args, "") == -1 ||
-         fuse_opt_add_arg(&args, "-o") == -1 ||
+        (fuse_opt_add_arg(&args, "-o") == -1 ||
          fuse_opt_add_arg(&args, opts) == -1)) {
         fuse_opt_free_args(&args);
         return NULL;
index a72294bef461e4f308199e9e1ab367631fa777fe..cbdedf36851d01692cdbe2a3be175ef2a53f71a2 100644 (file)
@@ -151,7 +151,7 @@ static int receive_fd(int fd)
     struct iovec iov;
     char buf[1];
     int rv;
-    char ccmsg[CMSG_SPACE(sizeof(int))];
+    size_t ccmsg[CMSG_SPACE(sizeof(int)) / sizeof(size_t)];
     struct cmsghdr *cmsg;
 
     iov.iov_base = buf;
index 9e9c2b65a1b91676be86c21ebccd9b0c7320ace5..bf27b36a8b6a916965b281092134d424e9111a45 100644 (file)
@@ -75,7 +75,7 @@ static int ulockmgr_send_message(int sock, void *buf, size_t buflen,
     struct msghdr msg;
     struct cmsghdr *p_cmsg;
     struct iovec vec;
-    char cmsgbuf[CMSG_SPACE(sizeof(int) * MAX_SEND_FDS)];
+    size_t cmsgbuf[CMSG_SPACE(sizeof(int) * MAX_SEND_FDS) / sizeof(size_t)];
     int res;
 
     assert(numfds <= MAX_SEND_FDS);
index 47f335c215cb7d254c82c83eedd3383751786285..70903a0510bbbd595e757a0992236035ff8aa607 100644 (file)
@@ -437,7 +437,7 @@ static int has_fuseblk(void)
         return 1;
 
     while (fgets(buf, sizeof(buf), f))
-        if (strcmp(buf, "fuseblk\n") == 0) {
+        if (strstr(buf, "fuseblk\n")) {
             fclose(f);
             return 1;
         }
@@ -883,7 +883,7 @@ static int send_fd(int sock_fd, int fd)
     struct msghdr msg;
     struct cmsghdr *p_cmsg;
     struct iovec vec;
-    char cmsgbuf[CMSG_SPACE(sizeof(fd))];
+    size_t cmsgbuf[CMSG_SPACE(sizeof(fd)) / sizeof(size_t)];
     int *p_fds;
     char sendchar = 0;
 
index 0d00975f44ca415a1e211d75f2ccaafc2e583d53..211d74ace30dc9b80b5575e99c0835e4153e4b73 100644 (file)
@@ -58,7 +58,7 @@ static int receive_message(int sock, void *buf, size_t buflen, int *fdp,
 {
     struct msghdr msg;
     struct iovec iov;
-    char ccmsg[CMSG_SPACE(sizeof(int)) * MAX_SEND_FDS];
+    size_t ccmsg[CMSG_SPACE(sizeof(int) * MAX_SEND_FDS) / sizeof(size_t)];
     struct cmsghdr *cmsg;
     int res;
     int i;