Re: Uploading new s3ql to testing-proposed-updates
On 02/24/2013 06:41 PM, Nikolaus Rath wrote:
> Hi,
>
> I'd like to upload a new version of S3QL to testing-proposed-updates to
> fix bug #701350. Unstable already contains a newer upstream release
> (1.12), so I cannot upload there.
>
> Essentially, a missing fflush() call when accessing a file using both a
> FILE* stream and a file descriptor causes data loss. For some reason I
> this hasn't yet caused problems with wheezy's eglibc 2.13 (the problem
> was discovered with eglibc 2.17), but I think relying on this to keep
> working mysteriously would be irresponsible.
>
> The necessary patch is one line (adding fflush() in the right place).
I've attached the proposed debdiff.
Best,
-Nikolaus
--
»Time flies like an arrow, fruit flies like a Banana.«
PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6 02CF A9AD B7F8 AE4E 425C
diff -Nru s3ql-1.11.1/debian/changelog s3ql-1.11.1/debian/changelog
--- s3ql-1.11.1/debian/changelog 2012-06-05 13:35:58.000000000 -0700
+++ s3ql-1.11.1/debian/changelog 2013-02-24 18:52:36.000000000 -0800
@@ -1,3 +1,10 @@
+s3ql (1.11.1-3) testing-proposed-updates; urgency=low
+
+ * Call fflush() on FILE stream before repositioning underlying
+ file descriptor. Closes: 701350.
+
+ -- Nikolaus Rath <Nikolaus@rath.org> Sun, 24 Feb 2013 18:51:42 -0800
+
s3ql (1.11.1-2) unstable; urgency=low
* Add dependency on python-pkg-resources. Closes: 672916.
diff -Nru s3ql-1.11.1/debian/patches/deltadump_fflush.diff s3ql-1.11.1/debian/patches/deltadump_fflush.diff
--- s3ql-1.11.1/debian/patches/deltadump_fflush.diff 1969-12-31 16:00:00.000000000 -0800
+++ s3ql-1.11.1/debian/patches/deltadump_fflush.diff 2013-02-24 18:55:19.000000000 -0800
@@ -0,0 +1,29 @@
+Description: call fflush() to avoid data corruption
+Origin: upstream
+Applied-Upstream: http://code.google.com/p/s3ql/source/detail?r=e20279364896cfaa5d3c8cda29cb64c3b432a0ec
+Last-Update: 2013-02-24
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/src/s3ql/_deltadump.pyx
++++ b/src/s3ql/_deltadump.pyx
+@@ -28,6 +28,7 @@
+
+ cdef extern from 'stdio.h' nogil:
+ FILE * fdopen(int fd, const_char * mode)
++ int fflush(FILE * stream)
+ int fileno(FILE * stream)
+
+ cdef extern from 'endian.h' nogil:
+@@ -123,6 +124,12 @@
+
+ cdef ssize_t off
+
++ # Explicitly flush data that needs to be written. This is
++ # important, so that we can safely reposition the fd position
++ # below (which is necessary in case there is cached input data)
++ if fflush(fp) != 0:
++ raise OSError(errno, strerror(errno))
++
+ # Reposition FD to position of FILE*, otherwise next read from FD will miss
+ # data currently in stream buffer. It seems that call to fflush() achieves
+ # the same thing, but this does not seem to be documented so we don't rely
diff -Nru s3ql-1.11.1/debian/patches/series s3ql-1.11.1/debian/patches/series
--- s3ql-1.11.1/debian/patches/series 2012-01-23 17:39:07.000000000 -0800
+++ s3ql-1.11.1/debian/patches/series 2013-02-24 18:51:23.000000000 -0800
@@ -1 +1,2 @@
proc_mount.diff
+deltadump_fflush.diff
Reply to: