Hello community,
here is the log from the commit of package fusecompress
checked in at Wed Sep 24 15:24:02 CEST 2008.
--------
--- fusecompress/fusecompress.changes 2008-09-05 17:27:06.000000000 +0200
+++ /mounts/work_src_done/STABLE/fusecompress/fusecompress.changes 2008-09-18 14:41:15.000000000 +0200
@@ -1,0 +2,12 @@
+Thu Sep 18 14:39:36 CEST 2008 - uli@suse.de
+
+- update -> SVN trunk (r76)
+ - update README
+ - make allow_other,suid,dev,noterm default for FSs mounted as root
+ - limit number of errors reported per file (issue #27)
+ - added "noterm" option rewiring SIGTERM from "unmount" to "purge files",
+ which keeps root-mounted filesystems from dying before their time (sort
+ of issue #25)
+ - replaced outdated BUGS file with reference to bugtracker
+
+-------------------------------------------------------------------
Old:
----
fusecompress-0.9.2svn20080905.tar.gz
New:
----
fusecompress-0.9.2svn20080918.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ fusecompress.spec ++++++
--- /var/tmp/diff_new_pack.g19027/_old 2008-09-24 15:23:43.000000000 +0200
+++ /var/tmp/diff_new_pack.g19027/_new 2008-09-24 15:23:43.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package fusecompress (Version 0.9.2svn20080905)
+# spec file for package fusecompress (Version 0.9.2svn20080918)
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@@ -22,7 +22,7 @@
License: GPL v2 only
Group: System/Filesystems
AutoReqProv: on
-Version: 0.9.2svn20080905
+Version: 0.9.2svn20080918
Release: 1
Summary: FUSE-based filesystem with transparent compression
Source: %name-%version.tar.gz
@@ -79,6 +79,15 @@
%_bindir/*
%changelog
+* Thu Sep 18 2008 uli@suse.de
+- update -> SVN trunk (r76)
+ - update README
+ - make allow_other,suid,dev,noterm default for FSs mounted as root
+ - limit number of errors reported per file (issue #27)
+ - added "noterm" option rewiring SIGTERM from "unmount" to "purge files",
+ which keeps root-mounted filesystems from dying before their time (sort
+ of issue #25)
+ - replaced outdated BUGS file with reference to bugtracker
* Fri Sep 05 2008 uli@suse.de
- update -> SVN trunk (r69)
- added mechanism for selectively enabling and disabling debug output at
++++++ fusecompress-0.9.2svn20080905.tar.gz -> fusecompress-0.9.2svn20080918.tar.gz ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/fusecompress/BUGS new/fusecompress/BUGS
--- old/fusecompress/BUGS 2008-08-05 17:20:08.000000000 +0200
+++ new/fusecompress/BUGS 2008-09-17 15:46:32.000000000 +0200
@@ -1,22 +1,2 @@
-Hardlinks:
-The second read() on file "b" in test/link.c doesn't get through to us. FUSE
-seems to assume instead that the data is still the same as when reading it
-the first time. This is a bug in FUSE, NTFS-3G exhibits the same problem. It
-is triggered by Firefox and probably other software doing funny stuff with
-hardlinks.
-If you use FuseCompress as your root filesystem, you may want to
-put /tmp in tmpfs.
-
-direct_rename():
-This function tries to reroute all pointers to the original file object to
-the new one. Subsequently it asserts that there are no more accesses to the
-original file. When running dbench I once saw that assertion fail. This is
-very hard to reproduce. May be a locking issue.
-
-errors in compressed data:
-Error handling in the compression modules is not good. For cut-off data, for
-instance, LZO returns an error on the first try, but zero on subsequent
-tries. LZMA always returns zero. This can lead to (virtually) endless loops
-in some applications. We are trying to return a serious error (EIO) if we
-detect corrupt compressed data, but that does not keep some programs from
-trying over and over.
+FuseCompress 0.9.x bugtracking can be found at:
+http://code.google.com/p/fusecompress/issues/list
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/fusecompress/compress.c new/fusecompress/compress.c
--- old/fusecompress/compress.c 2008-08-22 17:18:30.000000000 +0200
+++ new/fusecompress/compress.c 2008-09-17 15:54:47.000000000 +0200
@@ -312,7 +312,7 @@
fd = file_open(file->filename, O_RDWR);
if (fd == FAIL) {
- ERR_("\tfailed to open file %s: %d",file->filename,errno);
+ FILEERR_(file, "\tfailed to open file %s: %d",file->filename,errno);
// Something wrong happend, mark file as deleted to break the
// loop in _direct_open_purge when this function is called by it.
@@ -323,7 +323,7 @@
res = fstat(fd, &statbuf);
if (res == FAIL) {
- ERR_("\tfailed to fstat file");
+ FILEERR_(file, "\tfailed to fstat file");
// Something wrong happend, mark file as delete to break the
// loop in _direct_open_purge when this function is called by it.
@@ -376,7 +376,7 @@
//
res = file_write_header(fd_temp, compressor, statbuf.st_size);
if (res == FAIL) {
- ERR_("\tfailed to write header");
+ FILEERR_(file, "\tfailed to write header");
goto out;
}
@@ -451,7 +451,7 @@
res = rename(temp, file->filename);
if (res == FAIL) {
- ERR_("\tfailed to rename %s to %s",temp,file->filename);
+ FILEERR_(file, "\tfailed to rename %s to %s",temp,file->filename);
goto out;
}
free(temp);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/fusecompress/direct_compress.c new/fusecompress/direct_compress.c
--- old/fusecompress/direct_compress.c 2008-09-05 17:10:31.000000000 +0200
+++ new/fusecompress/direct_compress.c 2008-09-17 15:53:51.000000000 +0200
@@ -442,7 +442,7 @@
ret = file->compressor->close(descriptor->handle);
if(ret < 0)
{
- ERR_("unable to close compressor on file %s", file->filename);
+ FILEERR_(file, "unable to close compressor on file %s", file->filename);
return FAIL;
}
descriptor->offset = 0;
@@ -450,7 +450,7 @@
ret = lseek(descriptor->fd, sizeof(header_t), SEEK_SET);
if(ret != sizeof(header_t))
{
- ERR_("unable to seek back to beginning of compressed data on file %s", file->filename);
+ FILEERR_(file, "unable to seek back to beginning of compressed data on file %s", file->filename);
return FAIL;
}
}
@@ -512,7 +512,7 @@
len = file->compressor->read(descriptor->handle, skipbuf, readsize);
DEBUG_("tried %zd bytes, got %d (file size %zd)",readsize,len,file->size);
if(len < 0) {
- ERR_("failed to read from compressor");
+ FILEERR_(file, "failed to read from compressor");
errno = EIO;
return -1;
}
@@ -522,7 +522,7 @@
assuming that if file->size == -1,
something bad (probably another failed
read) happened before.) */
- ERR_("short read while skipping in compressed file %s (probably corrupt)",file->filename);
+ FILEERR_(file, "short read while skipping in compressed file %s (probably corrupt)",file->filename);
errno = EIO;
return -1;
}
@@ -546,13 +546,13 @@
len = file->compressor->read(descriptor->handle, buffer, size);
if (len < 0)
{
- ERR_("failed to read from compressor (file %s)", file->filename);
+ FILEERR_(file, "failed to read from compressor (file %s)", file->filename);
errno = EIO;
return -1;
}
if (len < size) {
/* Again, this should have worked. */
- ERR_("short read in compressed file %s (probably corrupt)",file->filename);
+ FILEERR_(file, "short read in compressed file %s (probably corrupt)",file->filename);
errno = EIO;
return -1;
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/fusecompress/fusecompress.c new/fusecompress/fusecompress.c
--- old/fusecompress/fusecompress.c 2008-09-05 11:58:46.000000000 +0200
+++ new/fusecompress/fusecompress.c 2008-09-18 13:57:05.000000000 +0200
@@ -898,6 +898,51 @@
printf("%s version %d.%d.%d\n", "fusecompress", 0, 9, 1);
}
+#include
+static void sigterm_handler(int sig)
+{
+ assert(sig == SIGTERM);
+ /* use SIGTERM as a cue that we will be unmounted soon and
+ purge remaining files */
+ LOCK(&database.lock);
+ direct_open_purge_force();
+ UNLOCK(&database.lock);
+}
+
+/* Sets a SIGTERM handler to keep fusecompress from exiting on a SIGTERM.
+ A typical problem with FUSE filesystems mounted on / is that init scripts
+ send a SIGTERM (and, if the process survives, a SIGKILL) to all processes
+ before unmounting the filesystems. Normally, FUSE filesystems terminate
+ when receiving SIGTERM, which is very undesirable in this case. I have
+ therefore added the "noterm" option which instead takes SIGTERM as a cue
+ to flush as much as possible from the database to prevent long delays
+ while files in the database are compressed by the background thread.
+ (SIGKILL is even more disastrous as it will most likely result in data
+ corruption, but it cannot be handled by us. Instead, a fix to killall5
+ is necessary that exempts FUSE filesystems from being SIGKILLed.
+ See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=476698 .) */
+static int set_sigterm_handler(void)
+{
+ struct sigaction sa;
+ struct sigaction old_sa;
+
+ memset(&sa, 0, sizeof(struct sigaction));
+ sa.sa_handler = sigterm_handler;
+ sigemptyset(&(sa.sa_mask));
+ sa.sa_flags = 0;
+
+ if (sigaction(SIGTERM, NULL, &old_sa) == -1) {
+ perror("fusecompress: cannot get old signal handler");
+ return -1;
+ }
+
+ if (sigaction(SIGTERM, &sa, NULL) == -1) {
+ perror("fusecompress: cannot set signal handler");
+ return -1;
+ }
+ return 0;
+}
+
char compresslevel[3] = "wbx";
#define MAX_OPTS 50
@@ -920,6 +965,7 @@
#endif
;
int detach = 1;
+ int noterm = 0; /* do not exit on SIGTERM */
fusev[fusec++] = argv[0];
#ifdef DEBUG
@@ -928,6 +974,14 @@
fusev[fusec++] = "-o";
fusev[fusec++] = "nonempty,kernel_cache,default_permissions,use_ino";
+ if (geteuid() == 0)
+ {
+ /* default to the behavior people expect when mounting a filesystem as root */
+ fusev[fusec++] = "-o";
+ fusev[fusec++] = "allow_other,suid,dev";
+ noterm = 1;
+ }
+
root_fs = 0;
read_only = 0;
cache_decompressed_data = 0;
@@ -997,6 +1051,14 @@
{
compressor_default = find_compressor_name(o);
}
+ else if (!strcmp(o, "noterm"))
+ {
+ noterm = 1;
+ }
+ else if (!strcmp(o, "term"))
+ {
+ noterm = 0;
+ }
else
{
fusev[fusec++] = "-o";
@@ -1085,7 +1147,7 @@
compresslevel[2] = 0; /* minilzo and null ignore compress level */
break;
default:
- ERR_("unknonwn compressor type %d",compressor_default->type);
+ ERR_("unknown compressor type %d",compressor_default->type);
exit(EXIT_FAILURE);
break;
}
@@ -1155,6 +1217,12 @@
stderr = debugout;
#endif
+ if (noterm)
+ {
+ if (set_sigterm_handler())
+ WARN_("unable to set SIGTERM handler, will terminate on SIGTERM");
+ }
+
ret = fuse_main(fusec, fusev, &fusecompress_oper);
if (fs_opts) free(fs_opts);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/fusecompress/log.h new/fusecompress/log.h
--- old/fusecompress/log.h 2008-09-05 15:35:04.000000000 +0200
+++ new/fusecompress/log.h 2008-09-17 16:03:22.000000000 +0200
@@ -48,6 +48,11 @@
#define ERR_(fmt,...) \
barf(LOG_ERR, "ERR %s %d: " fmt, __PRETTY_FUNCTION__, __LINE__, ## __VA_ARGS__);
+#define MAX_ERRORS_PER_FILE 100
+#define FILEERR_(file, fmt, ...) \
+ if (file->errors_reported == MAX_ERRORS_PER_FILE) { file->errors_reported++; ERR_("too many errors for file %s, squelching", file->filename); } \
+ else if (file->errors_reported < MAX_ERRORS_PER_FILE) { file->errors_reported++; ERR_(fmt, ## __VA_ARGS__); }
+
#define CRIT_(fmt,...) \
barf(LOG_CRIT, "CRIT: %s %d: " fmt, __PRETTY_FUNCTION__, __LINE__, ## __VA_ARGS__);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/fusecompress/README new/fusecompress/README
--- old/fusecompress/README 2008-08-12 13:38:41.000000000 +0200
+++ new/fusecompress/README 2008-09-18 14:30:24.000000000 +0200
@@ -1,11 +1,15 @@
FuseCompress
- http://www.miio.net/fusecompress
+============
+
+http://fusecompress.googlecode.com/
We are not responsible for any badness that may happen to you while using
this software.
-News:
+NEWS
+~~~~
+ after 0.9.1.1: see http://code.google.com/p/fusecompress/source/list
0.9.1.1 Buffer overflow from command line parsing fixed. Fix bug that
caused permition problems on read-only files.
0.9.1 File format has been changed. It allows better cooperation with
@@ -21,69 +25,80 @@
0.8.1 README updated.
0.8 Major update. New format for storing compressed files is used.
-License:
-
-This program is distributed under GNU/GPL version 2
-
-
-Todo:
- - Optimization
-
-Installation & compilation:
+LICENSE
+~~~~~~~
+This program is distributed under the terms of the GNU Public License
+version 2.
+
+TODO
+~~~~
+See http://code.google.com/p/fusecompress/issues/list
+
+INSTALLATION
+~~~~~~~~~~~~
+To compile a release build, run
make release
-Usage:
-
- fusecompress [OPTIONS] /storage/directory/
+For more information, see
+http://code.google.com/p/fusecompress/wiki/BuildHOWTO
- -h print this help
- -c lzo/bz2/gz/lzma/null choose default compression method
- -l LEVEL set compression level (1 to 9)
- -o ... pass arguments to fuse library
-
- You can mount filesystem over existing directory with files.
- Files will be compressed when you work with filesystem. Even a
- simple 'find /storage' will compress them. Note that some of the last files
- found are not compressed - this is called cache and increases
- performance on frequently accessed files. These files are compressed
- when the filesystem is unmounted.
+USAGE
+~~~~~
+ fusecompress [OPTIONS] /storage/directory [/mount/point]
+ -h print this help
+ -v print version
+ -c lzo/bz2/gz/lzma/null choose default compression method
+ -l LEVEL set compression level (1 to 9)
+ -o ... pass arguments to fuse library
+
+You can mount filesystem over existing directory with files by omitting the
+last parameter. Files will be compressed when you work with filesystem. Even
+a simple 'find /storage' will compress them. Note that some of the last
+files found are not compressed - this increases performance on frequently
+accessed files. These files are compressed when the filesystem is unmounted
+or (if mounted with "-o noterm" (default for root)) when the fusecompress
+process receives a SIGTERM signal.
Useful parameters for FUSE library:
- The FUSE library must be configured to support these features - the configuration
- file /etc/fuse.conf must contains at least the option "user_allow_other".
+The FUSE library must be configured to support these features - the configuration
+file /etc/fuse.conf must contains at least the option "user_allow_other".
- allow_other
-
- This option overrides the security measure restricting file access
- to the user mounting the filesystem. So all users (including root)
- can access the files. This option is by default only allowed for
- root, but this restriction can be removed with the configuration
- option described in the previous section.
-
- allow_root
-
- This option is similar to 'allow_other', but file access is limited
- to the user mounting the filesystem and root. This option and
- 'allow_other' are mutually exclusive.
-
-Tips and tricks:
-
- How can I find out about the compression ratio?
-
- Run this command in the FuseCompressed directory when mounted
- with FuseCompress:
- du -sh
- du -sh --apparent-size
-
- The first command prints the total uncompressed size of all
- files in the current directory and its subdirectories while
- the second one prints the total compressed size.
-
- When the FuseCompress filesystem is not mounted, run `ls -l
- my_file.dat` and compare the file size with the value
- obtained with `file my_file.dat`.
+allow_other
+
+ This option overrides the security measure restricting file
+ access to the user mounting the filesystem. So all users
+ (including root) can access the files. This option is by
+ default only allowed (and automatically enabled) for root,
+ but this restriction can be removed with the configuration
+ option described in the previous section.
+
+allow_root
+
+ This option is similar to 'allow_other', but file access is limited
+ to the user mounting the filesystem and root. This option and
+ 'allow_other' are mutually exclusive.
+
+More information can be found at
+http://code.google.com/p/fusecompress/wiki/Usage
+
+TIPS AND TRICKS
+~~~~~~~~~~~~~~~
+How can I find out about the compression ratio?
+
+ Run this command in the FuseCompressed directory when mounted
+ with FuseCompress:
+ du -sh
+ du -sh --apparent-size
+
+ The first command prints the total uncompressed size of all
+ files in the current directory and its subdirectories while
+ the second one prints the total compressed size.
+
+ When the FuseCompress filesystem is not mounted, run `ls -l
+ my_file.dat` and compare the file size with the value
+ obtained with `file my_file.dat`.
File and magic utilities:
@@ -99,8 +114,8 @@
3 byte >0x04 (unknown format)
4 long x uncompressed size: %d
-Authors:
-
+AUTHORS
+~~~~~~~
Milan Svoboda (original author)
Anders Aagaard (direct compress feature)
Ulrich Hecht (LZMA module, tools, test suite, bugfixes, maintainer)
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/fusecompress/structs.h new/fusecompress/structs.h
--- old/fusecompress/structs.h 2008-08-22 17:17:16.000000000 +0200
+++ new/fusecompress/structs.h 2008-09-17 15:52:21.000000000 +0200
@@ -91,6 +91,8 @@
void** cache;
int cache_size;
+
+ int errors_reported; /**< Number of errors reported for this file */
pthread_mutex_t lock;
pthread_cond_t cond;
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org