Hello community,
here is the log from the commit of package fusecompress
checked in at Mon Nov 17 16:49:23 CET 2008.
--------
--- fusecompress/fusecompress.changes 2008-10-06 15:32:01.000000000 +0200
+++ /mounts/work_src_done/STABLE/fusecompress/fusecompress.changes 2008-11-12 12:08:09.000000000 +0100
@@ -1,0 +2,14 @@
+Wed Nov 12 12:07:56 CET 2008 - uli@suse.de
+
+- update -> SVN trunk (r81)
+ - fix stale cache problem properly (issue #32), add test
+ - LZO is non-deterministic, do not check compressed data in tc.sh
+
+-------------------------------------------------------------------
+Tue Nov 11 16:13:01 CET 2008 - uli@suse.de
+
+- update -> SVN trunk (r78)
+ - invalidate cache when modifying files (issue #32)
+ - support liblzma 4.999.5 (issue #31)
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
Old:
----
fusecompress-0.9.2svn20081006.tar.gz
New:
----
fusecompress-0.9.2svn20081112.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ fusecompress.spec ++++++
--- /var/tmp/diff_new_pack.O30624/_old 2008-11-17 16:49:05.000000000 +0100
+++ /var/tmp/diff_new_pack.O30624/_new 2008-11-17 16:49:05.000000000 +0100
@@ -1,5 +1,5 @@
#
-# spec file for package fusecompress (Version 0.9.2svn20081006)
+# spec file for package fusecompress (Version 0.9.2svn20081112)
#
# 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.2svn20081006
+Version: 0.9.2svn20081112
Release: 1
Summary: FUSE-based filesystem with transparent compression
Source: %name-%version.tar.gz
@@ -79,6 +79,14 @@
%_bindir/*
%changelog
+* Wed Nov 12 2008 uli@suse.de
+- update -> SVN trunk (r81)
+ - fix stale cache problem properly (issue #32), add test
+ - LZO is non-deterministic, do not check compressed data in tc.sh
+* Tue Nov 11 2008 uli@suse.de
+- update -> SVN trunk (r78)
+ - invalidate cache when modifying files (issue #32)
+ - support liblzma 4.999.5 (issue #31)
* Mon Oct 06 2008 uli@suse.de
- update -> SVN trunk (r77)
- stuff memleak by freeing cache arrays (issue #30)
++++++ fusecompress-0.9.2svn20081006.tar.gz -> fusecompress-0.9.2svn20081112.tar.gz ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/fusecompress/compress.c new/fusecompress/compress.c
--- old/fusecompress/compress.c 2008-10-06 14:33:57.000000000 +0200
+++ new/fusecompress/compress.c 2008-11-11 15:09:13.000000000 +0100
@@ -131,22 +131,7 @@
}
}
- if (file->cache)
- {
- int i;
- for (i = 0; i < file->cache_size ; i++)
- {
- if (file->cache[i])
- {
- decomp_cache_size -= DC_PAGE_SIZE;
- free(file->cache[i]);
- }
- }
- free(file->cache);
- file->cache = NULL;
- file->cache_size = 0;
- DEBUG_("decomp_cache_size %d", decomp_cache_size);
- }
+ flush_file_cache(file);
// Open file
//
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/fusecompress/compress_lzma.c new/fusecompress/compress_lzma.c
--- old/fusecompress/compress_lzma.c 2008-08-15 14:48:09.000000000 +0200
+++ new/fusecompress/compress_lzma.c 2008-11-11 15:40:10.000000000 +0100
@@ -16,6 +16,12 @@
#include
#include
+#if LZMA_VERSION <= UINT32_C(49990030)
+#define LZMA_EASY_ENCODER lzma_easy_encoder_single
+#else
+#define LZMA_EASY_ENCODER lzma_easy_encoder
+#endif
+
#include "structs.h"
#include "globals.h"
#include "file.h"
@@ -50,9 +56,9 @@
}
/* init LZMA encoder */
lzma_stream lstr = lzma_stream_init;
- ret = lzma_easy_encoder_single(&lstr, LZMA_EASY_COPY + compresslevel[2] - '0');
+ ret = LZMA_EASY_ENCODER(&lstr, LZMA_EASY_COPY + compresslevel[2] - '0');
if(ret != LZMA_OK) {
- ERR_("lzma_easy_encoder_single failed: %d",ret);
+ ERR_("LZMA_EASY_ENCODER failed: %d",ret);
close(dup_fd);
return (off_t)FAIL;
}
@@ -145,7 +151,11 @@
/* init LZMA decoder */
lzma_stream lstr = lzma_stream_init;
+#if LZMA_VERSION <= UINT32_C(49990030)
ret = lzma_auto_decoder(&lstr, NULL, NULL);
+#else
+ ret = lzma_auto_decoder(&lstr, -1, 0);
+#endif
if(ret != LZMA_OK) {
ERR_("lzma_auto_decoder failed");
close(dup_fd);
@@ -213,11 +223,15 @@
lf->str = lzma_stream_init;
lf->mode = mode[0];
if(mode[0] == 'r') {
+#if LZMA_VERSION <= UINT32_C(49990030)
ret = lzma_auto_decoder(&lf->str, NULL, NULL);
+#else
+ ret = lzma_auto_decoder(&lf->str, -1, 0);
+#endif
lf->str.avail_in = 0;
}
else {
- ret = lzma_easy_encoder_single(&lf->str, LZMA_EASY_COPY + mode[2] - '0');
+ ret = LZMA_EASY_ENCODER(&lf->str, LZMA_EASY_COPY + mode[2] - '0');
}
if(ret != LZMA_OK) return NULL;
return (void*)lf;
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-10-06 15:20:38.000000000 +0200
+++ new/fusecompress/direct_compress.c 2008-11-11 19:09:58.000000000 +0100
@@ -47,10 +47,9 @@
*/
#define MAX_DATABASE_LEN 30
-void direct_open_delete(file_t *file)
+void flush_file_cache(file_t* file)
{
NEED_LOCK(&file->lock);
-
if (file->cache)
{
int i;
@@ -67,7 +66,14 @@
file->cache = NULL;
file->cache_size = 0;
}
+}
+
+void direct_open_delete(file_t *file)
+{
+ NEED_LOCK(&file->lock);
+ flush_file_cache(file);
+
// It's out of the database, so we can unlock and destroy it
//
UNLOCK(&file->lock);
@@ -584,6 +590,10 @@
NEED_LOCK(&file->lock);
+ flush_file_cache(file); /* This may be superfluous. It did fix issue #32, but that may have been only
+ due to the fact that it destroyed the cache falsely inherited by file_to
+ in direct_rename(), which should have already been destroyed there. */
+
DEBUG_("('%s'), offset: %zi, descriptor->offset: %zi",
file->filename, offset, descriptor->offset);
STAT_(STAT_DIRECT_WRITE);
@@ -730,6 +740,10 @@
DEBUG_("\tfile_from->compressor: %p, file_from->size: %zi, file_from->accesses: %d",
file_from->compressor, file_from->size, file_from->accesses);
+ /* file_to may be an existing file that is overwritten, so we need to
+ destroy its cache */
+ flush_file_cache(file_to);
+
file_to->size = file_from->size;
file_to->compressor = file_from->compressor;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/fusecompress/direct_compress.h new/fusecompress/direct_compress.h
--- old/fusecompress/direct_compress.h 2008-08-15 15:09:08.000000000 +0200
+++ new/fusecompress/direct_compress.h 2008-11-11 15:09:57.000000000 +0100
@@ -34,4 +34,6 @@
void direct_delete(file_t *file);
file_t *direct_rename(file_t *file_from, file_t *file_to);
+void flush_file_cache(file_t* file);
+
#endif
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/fusecompress/test/stale_cache.py new/fusecompress/test/stale_cache.py
--- old/fusecompress/test/stale_cache.py 1970-01-01 01:00:00.000000000 +0100
+++ new/fusecompress/test/stale_cache.py 2008-11-11 18:52:32.000000000 +0100
@@ -0,0 +1,36 @@
+# check if we get up-to-date data renaming over an existing cached file
+
+import os
+import sys
+import shutil
+import time
+import stat
+
+os.mkdir('test')
+os.system('../fusecompress -o lzma,cache_skipped,detach test')
+a = open('test/a','w')
+a.write('blafwpegfjwegwegherjhj32r0grobfn23t-=wefopjweofewfjwopefjp' * 1000)
+a.close()
+b = open('test/b','w')
+b.write('1111111111111111111111111111111111111111111111111111111111' * 1000)
+b.close()
+time.sleep(1)
+os.system('fusermount -u test')
+time.sleep(1)
+os.system('../fusecompress -s log -o lzma,cache_skipped,detach test')
+
+a = open('test/a','r+')
+a.seek(10000)
+a.read(100) # fusecompress caches skipped part
+a.seek(0)
+a.close()
+os.rename('test/b', 'test/a')
+a = open('test/a','r')
+if not '111111' in a.read(4096):
+ os.abort()
+a.close()
+
+os.system('fusermount -u test')
+time.sleep(1)
+shutil.rmtree('test')
+sys.exit(0)
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/fusecompress/test/tc.sh new/fusecompress/test/tc.sh
--- old/fusecompress/test/tc.sh 2008-08-15 14:22:29.000000000 +0200
+++ new/fusecompress/test/tc.sh 2008-11-11 18:03:47.000000000 +0100
@@ -6,7 +6,7 @@
gcc -g -I.. -DMODULE=$i -o tc tc.c ../compress_*.c ../file.c ../minilzo/lzo.c ../globals.c -llzma -lbz2 -lz -llzo2
./tc
cmp in back_in
- cmp out back_out
+ test "$i" = "module_lzo" || cmp out back_out
cmp in and_in_again
rm back_in out back_out and_in_again
done
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org