[packages/s3fs] Fix local cache size/mtime check

jajcus jajcus at pld-linux.org
Thu Jan 3 10:21:39 CET 2013


commit 60a3f1e3f8a159e77048ab70d6119d36dcdb675f
Author: Jacek Konieczny <j.konieczny at eggsoft.pl>
Date:   Thu Jan 3 10:19:22 2013 +0100

    Fix local cache size/mtime check
    
    Compare actual values instead of their string representation
    and use the default mode if no meta-data is attached to the file.

 s3fs-cache_check.patch | 14 ++++++++++++++
 s3fs.spec              |  2 ++
 2 files changed, 16 insertions(+)
---
diff --git a/s3fs.spec b/s3fs.spec
index 000ee73..46e9fdf 100644
--- a/s3fs.spec
+++ b/s3fs.spec
@@ -9,6 +9,7 @@ Source0:	http://s3fs.googlecode.com/files/%{name}-%{version}.tar.gz
 # Source0-md5:	0dd7b7e9b1c58312cde19894488c5072
 Patch0:		%{name}-x-amz-meta.patch
 Patch1:		%{name}-missing_mode.patch
+Patch2:		%{name}-cache_check.patch
 URL:		http://code.google.com/p/s3fs/wiki/FuseOverAmazon
 BuildRequires:	curl-devel
 BuildRequires:	libfuse-devel
@@ -31,6 +32,7 @@ e.g., rsync backup to s3.
 %setup -q
 %patch0 -p0
 %patch1 -p1
+%patch2 -p1
 
 %build
 %configure
diff --git a/s3fs-cache_check.patch b/s3fs-cache_check.patch
new file mode 100644
index 0000000..fb3b3ad
--- /dev/null
+++ b/s3fs-cache_check.patch
@@ -0,0 +1,14 @@
+diff -dur s3fs-1.61.orig/src/s3fs.cpp s3fs-1.61/src/s3fs.cpp
+--- s3fs-1.61.orig/src/s3fs.cpp	2013-01-03 10:05:41.000000000 +0100
++++ s3fs-1.61/src/s3fs.cpp	2013-01-03 10:13:01.000000000 +0100
+@@ -532,8 +535,8 @@
+ 
+       // if the local and remote mtime/size
+       // do not match we have an invalid cache entry
+-      if(str(st.st_size) != responseHeaders["Content-Length"] || 
+-        (str(st.st_mtime) != responseHeaders["x-amz-meta-mtime"])) {
++      if(st.st_size != strtoul(responseHeaders["Content-Length"].c_str(), (char **) NULL, 10) || 
++         st.st_mtime != get_mtime(responseHeaders["x-amz-meta-mtime"].c_str())) {
+         if(close(fd) == -1)
+           YIKES(-errno);
+ 
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/s3fs.git/commitdiff/60a3f1e3f8a159e77048ab70d6119d36dcdb675f



More information about the pld-cvs-commit mailing list