[PATCH] Make len parameter of do_punch_hole OFF_T

Yuxuan Shui yshuiv7 at gmail.com
Mon May 25 17:30:13 UTC 2020


The argument passed to do_punch_hole is a OFF_T to beginning with, and
otherwise holes bigger than 2G will cause rsync to fail.
---
 syscall.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/syscall.c b/syscall.c
index e1a02a3c..e8ce7d5c 100644
--- a/syscall.c
+++ b/syscall.c
@@ -523,7 +523,7 @@ OFF_T do_fallocate(int fd, OFF_T offset, OFF_T length)
 
 /* Punch a hole at pos for len bytes. The current file position must be at pos and will be
  * changed to be at pos + len. */
-int do_punch_hole(int fd, UNUSED(OFF_T pos), int len)
+int do_punch_hole(int fd, UNUSED(OFF_T pos), OFF_T len)
 {
 #ifdef HAVE_FALLOCATE
 # ifdef HAVE_FALLOC_FL_PUNCH_HOLE
-- 
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/36eea89f/signature.sig>


More information about the rsync mailing list