[PATCH] clear sparse_past_write in sparse_end

Yuxuan Shui yshuiv7 at gmail.com
Mon May 25 16:07:44 UTC 2020


Otherwise when write_sparse is called for the next file, do_punch_hole
will be called with a `pos` that's not actually the current position in
file, causing it to fail.
---
 fileio.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fileio.c b/fileio.c
index bd2e36ae..32dc62da 100644
--- a/fileio.c
+++ b/fileio.c
@@ -44,6 +44,8 @@ int sparse_end(int f, OFF_T size)
 {
 	int ret;
 
+	sparse_past_write = 0;
+
 	if (!sparse_seek)
 		return 0;
 
-- 
2.26.2

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/rsync/attachments/20200525/080e7477/signature.sig>


More information about the rsync mailing list