diff -ruw fuse-2.7.0.org/ChangeLog fuse-2.7.0/ChangeLog --- fuse-2.7.0.org/ChangeLog 2007-07-02 13:32:15.000000000 +0200 +++ fuse-2.7.0/ChangeLog 2007-09-18 15:00:30.000000000 +0200 @@ -1,3 +1,33 @@ +2007-09-18 Miklos Szeredi + + * Add missing context initialization in fuse_fs_chmod(). Bug + found by "iohead" + + * Fix kernel module compilation for 2.6.23. Based on patch by + Marian Marinov + +2007-09-04 Philippe Elie + + * lib/fuse_lowlevel.c: fix a fuse_req leak in do_forget() + +2007-07-31 Miklos Szeredi + + * Work around hotplug issue, that it calls filesystem with file + descriptors 0, 1 and 2 not open. Tracked down by Leif Johnson + +2007-07-25 Miklos Szeredi + + * Don't call /bin/[u]mount if /etc/mtab is a symlink. Reported by + Tomas M + + * Also don't touch /etc/mtab if it is within the mounted + filesystem. Suggested by Jeffrey Law + +2007-07-12 Miklos Szeredi + + * Reset args->argc in fuse_opt_free_args(). Patch by Lucas + C. Villa Real + 2007-07-02 Miklos Szeredi * Released 2.7.0 diff -ruw fuse-2.7.0.org/include/fuse_kernel.h fuse-2.7.0/include/fuse_kernel.h --- fuse-2.7.0.org/include/fuse_kernel.h 2007-05-23 16:35:49.000000000 +0200 +++ fuse-2.7.0/include/fuse_kernel.h 2007-09-18 13:27:56.000000000 +0200 @@ -1,19 +1,14 @@ /* - FUSE: Filesystem in Userspace + This file defines the kernel interface of FUSE Copyright (C) 2001-2007 Miklos Szeredi This program can be distributed under the terms of the GNU GPL. See the file COPYING. -*/ - -/* This file defines the kernel interface of FUSE */ -#ifdef __FreeBSD__ -/* This -- and only this -- header file may also be distributed under the terms of the BSD Licence as follows: - Copyright (C) 2001-2006 Miklos Szeredi. All rights reserved. + Copyright (C) 2001-2007 Miklos Szeredi. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -37,6 +32,7 @@ SUCH DAMAGE. */ +#ifndef linux #include #define __u64 uint64_t #define __u32 uint32_t diff -ruw fuse-2.7.0.org/kernel/dev.c fuse-2.7.0/kernel/dev.c --- fuse-2.7.0.org/kernel/dev.c 2007-05-03 12:59:50.000000000 +0200 +++ fuse-2.7.0/kernel/dev.c 2007-09-18 15:00:31.000000000 +0200 @@ -1093,9 +1093,15 @@ int __init fuse_dev_init(void) { int err = -ENOMEM; +#ifdef KERNEL_2_6_23_PLUS + fuse_req_cachep = kmem_cache_create("fuse_request", + sizeof(struct fuse_req), + 0, 0, NULL); +#else fuse_req_cachep = kmem_cache_create("fuse_request", sizeof(struct fuse_req), 0, 0, NULL, NULL); +#endif if (!fuse_req_cachep) goto out; diff -ruw fuse-2.7.0.org/kernel/file.c fuse-2.7.0/kernel/file.c --- fuse-2.7.0.org/kernel/file.c 2007-07-02 13:32:15.000000000 +0200 +++ fuse-2.7.0/kernel/file.c 2007-09-18 15:00:31.000000000 +0200 @@ -865,7 +865,11 @@ .release = fuse_release, .fsync = fuse_fsync, .lock = fuse_file_lock, +#ifdef KERNEL_2_6_23_PLUS + .splice_read = generic_file_splice_read, +#else .sendfile = generic_file_sendfile, +#endif }; static struct file_operations fuse_direct_io_file_operations = { diff -ruw fuse-2.7.0.org/kernel/fuse_i.h fuse-2.7.0/kernel/fuse_i.h --- fuse-2.7.0.org/kernel/fuse_i.h 2007-07-02 13:32:15.000000000 +0200 +++ fuse-2.7.0/kernel/fuse_i.h 2007-09-18 15:00:33.000000000 +0200 @@ -45,6 +45,9 @@ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22) # define KERNEL_2_6_22_PLUS #endif +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,23) +# define KERNEL_2_6_23_PLUS +#endif #if defined(__arm__) && LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) #define DCACHE_BUG diff -ruw fuse-2.7.0.org/kernel/fuse_kernel.h fuse-2.7.0/kernel/fuse_kernel.h --- fuse-2.7.0.org/kernel/fuse_kernel.h 2007-05-23 16:35:49.000000000 +0200 +++ fuse-2.7.0/kernel/fuse_kernel.h 2007-09-18 13:27:56.000000000 +0200 @@ -1,19 +1,14 @@ /* - FUSE: Filesystem in Userspace + This file defines the kernel interface of FUSE Copyright (C) 2001-2007 Miklos Szeredi This program can be distributed under the terms of the GNU GPL. See the file COPYING. -*/ - -/* This file defines the kernel interface of FUSE */ -#ifdef __FreeBSD__ -/* This -- and only this -- header file may also be distributed under the terms of the BSD Licence as follows: - Copyright (C) 2001-2006 Miklos Szeredi. All rights reserved. + Copyright (C) 2001-2007 Miklos Szeredi. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -37,6 +32,7 @@ SUCH DAMAGE. */ +#ifndef linux #include #define __u64 uint64_t #define __u32 uint32_t diff -ruw fuse-2.7.0.org/kernel/inode.c fuse-2.7.0/kernel/inode.c --- fuse-2.7.0.org/kernel/inode.c 2007-07-02 13:32:15.000000000 +0200 +++ fuse-2.7.0/kernel/inode.c 2007-09-18 15:00:33.000000000 +0200 @@ -861,10 +861,18 @@ if (err) goto out_unreg; +#ifdef KERNEL_2_6_23_PLUS + fuse_inode_cachep = kmem_cache_create("fuse_inode", + sizeof(struct fuse_inode), + 0, SLAB_HWCACHE_ALIGN, + fuse_inode_init_once); +#else fuse_inode_cachep = kmem_cache_create("fuse_inode", sizeof(struct fuse_inode), 0, SLAB_HWCACHE_ALIGN, fuse_inode_init_once, NULL); +#endif + err = -ENOMEM; if (!fuse_inode_cachep) goto out_unreg2; diff -ruw fuse-2.7.0.org/lib/fuse.c fuse-2.7.0/lib/fuse.c --- fuse-2.7.0.org/lib/fuse.c 2007-07-02 13:33:08.000000000 +0200 +++ fuse-2.7.0/lib/fuse.c 2007-09-18 13:34:14.000000000 +0200 @@ -1425,6 +1425,7 @@ int fuse_fs_chmod(struct fuse_fs *fs, const char *path, mode_t mode) { + fuse_get_context()->private_data = fs->user_data; if (fs->op.chmod) return fs->op.chmod(path, mode); else diff -ruw fuse-2.7.0.org/lib/fuse_lowlevel.c fuse-2.7.0/lib/fuse_lowlevel.c --- fuse-2.7.0.org/lib/fuse_lowlevel.c 2007-07-02 13:32:17.000000000 +0200 +++ fuse-2.7.0/lib/fuse_lowlevel.c 2007-09-05 17:05:13.000000000 +0200 @@ -450,6 +450,8 @@ if (req->f->op.forget) req->f->op.forget(req, nodeid, arg->nlookup); + else + fuse_reply_none(req); } static void do_getattr(fuse_req_t req, fuse_ino_t nodeid, const void *inarg) diff -ruw fuse-2.7.0.org/lib/fuse_opt.c fuse-2.7.0/lib/fuse_opt.c --- fuse-2.7.0.org/lib/fuse_opt.c 2007-04-25 18:14:26.000000000 +0200 +++ fuse-2.7.0/lib/fuse_opt.c 2007-07-25 11:36:52.000000000 +0200 @@ -27,11 +27,14 @@ void fuse_opt_free_args(struct fuse_args *args) { - if (args && args->argv && args->allocated) { + if (args) { + if (args->argv && args->allocated) { int i; for (i = 0; i < args->argc; i++) free(args->argv[i]); free(args->argv); + } + args->argc = 0; args->argv = NULL; args->allocated = 0; } diff -ruw fuse-2.7.0.org/lib/helper.c fuse-2.7.0/lib/helper.c --- fuse-2.7.0.org/lib/helper.c 2007-07-02 13:32:17.000000000 +0200 +++ fuse-2.7.0/lib/helper.c 2007-08-08 20:22:01.000000000 +0200 @@ -190,7 +190,19 @@ struct fuse_args *args) { struct fuse_chan *ch; - int fd = fuse_mount_compat25(mountpoint, args); + int fd; + + /* + * Make sure file descriptors 0, 1 and 2 are open, otherwise chaos + * would ensue. + */ + do { + fd = open("/dev/null", O_RDWR); + if (fd > 2) + close(fd); + } while (fd >= 0 && fd <= 2); + + fd = fuse_mount_compat25(mountpoint, args); if (fd == -1) return NULL; diff -ruw fuse-2.7.0.org/lib/mount_util.c fuse-2.7.0/lib/mount_util.c --- fuse-2.7.0.org/lib/mount_util.c 2007-07-02 13:32:17.000000000 +0200 +++ fuse-2.7.0/lib/mount_util.c 2007-08-08 20:22:01.000000000 +0200 @@ -14,15 +14,34 @@ #include #include #include +#include #include #include +static int mtab_needs_update(const char *mnt) +{ + struct stat stbuf; + + /* If mtab is within new mount, don't touch it */ + if (strncmp(mnt, _PATH_MOUNTED, strlen(mnt)) == 0 && + _PATH_MOUNTED[strlen(mnt)] == '/') + return 0; + + if (lstat(_PATH_MOUNTED, &stbuf) != -1 && S_ISLNK(stbuf.st_mode)) + return 0; + + return 1; +} + int fuse_mnt_add_mount(const char *progname, const char *fsname, const char *mnt, const char *type, const char *opts) { int res; int status; + if (!mtab_needs_update(mnt)) + return 0; + res = fork(); if (res == -1) { fprintf(stderr, "%s: fork: %s\n", progname, strerror(errno)); @@ -72,6 +91,9 @@ int res; int status; + if (!mtab_needs_update(mnt)) + return 0; + res = fork(); if (res == -1) { fprintf(stderr, "%s: fork: %s\n", progname, strerror(errno)); diff -ruw fuse-2.7.0.org/README fuse-2.7.0/README --- fuse-2.7.0.org/README 2006-10-26 13:08:18.000000000 +0200 +++ fuse-2.7.0/README 2007-07-25 15:10:08.000000000 +0200 @@ -170,6 +170,12 @@ is still cached after the open(), so a read() system call will not always initiate a read operation. +auto_cache + + This option enables automatic flushing of the data cache on open(). + The cache will only be flushed if the modification time or the size + of the file has changed. + large_read Issue large read requests. This can improve performance for some @@ -197,6 +203,27 @@ The default is infinite. Note that the size of read requests is limited anyway to 32 pages (which is 128kbyte on i386). +max_readahead=N + + Set the maximum number of bytes to read-ahead. The default is + determined by the kernel. On linux-2.6.22 or earlier it's 131072 + (128kbytes) + +max_write=N + + Set the maximum number of bytes in a single write operation. The + default is 128kbytes. Note, that due to various limitations, the + size of write requests can be much smaller (4kbytes). This + limitation will be removed in the future. + +async_read + + Perform reads asynchronously. This is the default + +sync_read + + Perform all reads (even read-ahead) synchronously. + hard_remove The default behavior is that if an open file is deleted, the file is @@ -226,7 +253,19 @@ fsname=NAME - Sets the filesystem name. The default is the program name. + Sets the filesystem source (first field in /etc/mtab). The default + is the program name. + +subtype=TYPE + + Sets the filesystem type (third field in /etc/mtab). The default is + the program name. + + If the kernel suppports it, /etc/mtab and /proc/mounts will show the + filesystem type as "fuse.TYPE" + + If the kernel doesn't support subtypes, the source filed will be + "TYPE#NAME", or if fsname option is not specified, just "TYPE". use_ino @@ -271,6 +310,83 @@ Mount a filesystem backed by a block device. This is a privileged option. The device must be specified with the 'fsname=NAME' option. +entry_timeout=T + + The timeout in seconds for which name lookups will be cached. The + default is 1.0 second. For all the timeout options, it is possible + to give fractions of a second as well (e.g. "-oentry_timeout=2.8") + +negative_timeout=T + + The timeout in seconds for which a negative lookup will be cached. + This means, that if file did not exist (lookup retuned ENOENT), the + lookup will only be redone after the timeout, and the file/directory + will be assumed to not exist until then. The default is 0.0 second, + meaning that caching negative lookups are disabled. + +attr_timeout=T + + The timeout in seconds for which file/directory attributes are + cached. The default is 1.0 second. + +ac_attr_timeout=T + + The timeout in seconds for which file attributes are cached for the + purpose of checking if "auto_cache" should flush the file data on + open. The default is the value of 'attr_timeout' + +intr + + Allow requests to be interrupted. Turning on this option may result + in unexpected behavior, if the filesystem does not support request + interruption. + +intr_signal=NUM + + Specify which signal number to send to the filesystem when a request + is interrupted. The default is 10 (USR1). + +modules=M1[:M2...] + + Add modules to the filesystem stack. Modules are pushed in the + order they are specified, with the original filesystem being on the + bottom of the stack. + + +Modules distributed with fuse +----------------------------- + +iconv +````` +Perform file name character set conversion. Options are: + +from_code=CHARSET + + Character set to convert from (see iconv -l for a list of possible + values). Default is UTF-8. + +to_code=CHARSET + + Character set to convert to. Default is determined by the current + locale. + + +subdir +`````` +Prepend a given directory to each path. Options are: + +subdir=DIR + + Directory to prepend to all paths. This option is mandatory. + +rellinks + + Transform absolute symlinks into relative + +norellinks + + Do not transform absolute symlinks into relative. This is the default. + Reporting bugs ==============