Displaying 3 results from an estimated 3 matches for "sparse_seek".
2013 Sep 14
1
Rara data corruption with --sparse
Hi,
In fileio.c, function write_sparse() there is a bug that can lead
to corrupt copies if the write() call only completes partially.
for (l1 = 0; l1 < len && buf[l1] == 0; l1++) {}
for (l2 = 0; l2 < len-l1 && buf[len-(l2+1)] == 0; l2++) {}
sparse_seek += l1;
if (l1 == len)
return len;
if (sparse_seek)
do_lseek(f, sparse_seek, SEEK_CUR);
sparse_seek = l2;
After first calculating l1 (zero-prefix len) and l2 (zero-suffic len),
the code adds l1 to sparse_seek, seeks l1 bytes and resets spars...
2006 Jul 12
10
DO NOT REPLY [Bug 3925] New: rsync is unable to sync large (approx 4G) sparse files
https://bugzilla.samba.org/show_bug.cgi?id=3925
Summary: rsync is unable to sync large (approx 4G) sparse files
Product: rsync
Version: 2.6.8
Platform: x86
OS/Version: Linux
Status: NEW
Severity: major
Priority: P3
Component: core
AssignedTo: wayned@samba.org
ReportedBy:
2008 Mar 23
1
[PATCH] allow to change the block size used to handle sparse files
...yo | 10 ++++++++++
3 files changed, 21 insertions(+), 1 deletions(-)
diff --git a/fileio.c b/fileio.c
index f086494..39cae92 100644
--- a/fileio.c
+++ b/fileio.c
@@ -26,6 +26,7 @@
#endif
extern int sparse_files;
+extern long sparse_files_block_size;
static char last_byte;
static size_t sparse_seek = 0;
@@ -115,7 +116,7 @@ int write_file(int f,char *buf,size_t len)
while (len > 0) {
int r1;
if (sparse_files > 0) {
- int len1 = MIN(len, SPARSE_WRITE_SIZE);
+ int len1 = MIN(len, (size_t)sparse_files_block_size);
r1 = write_sparse(f, buf, len1);
} else {
if (!wf_writ...