From: Dave Chinner Date: Wed, 12 Dec 2018 17:42:40 +0000 (-0600) Subject: xfs_io: copy_file_range length is a size_t X-Git-Tag: v4.20.0-rc1~18 X-Git-Url: http://git.ipfire.org/?p=thirdparty%2Fxfsprogs-dev.git;a=commitdiff_plain;h=2a42470bf40761198e77f96fb4ec4a4ed49b212b xfs_io: copy_file_range length is a size_t copy_file_range() takes a size_t as it's length, not a "long long". Therefore we need to be able to pass sizes larger than 8EB to it to be able to test the interface fully and that requires copy_range to accept all values except an explicit error value of "-1LL". Signed-off-by: Dave Chinner Reviewed-by: Jan Tulak Reviewed-by: Darrick J. Wong Signed-off-by: Eric Sandeen --- diff --git a/io/copy_file_range.c b/io/copy_file_range.c index f118a3bfd..4e2969c9c 100644 --- a/io/copy_file_range.c +++ b/io/copy_file_range.c @@ -34,7 +34,7 @@ copy_range_help(void) * glibc buffered copy fallback. */ static loff_t -copy_file_range_cmd(int fd, long long *src, long long *dst, long long len) +copy_file_range_cmd(int fd, long long *src, long long *dst, size_t len) { loff_t ret; @@ -78,7 +78,7 @@ copy_range_f(int argc, char **argv) { long long src = 0; long long dst = 0; - long long len = 0; + size_t len = 0; int opt; int ret; int fd; @@ -104,7 +104,7 @@ copy_range_f(int argc, char **argv) break; case 'l': len = cvtnum(fsblocksize, fssectsize, optarg); - if (len < 0) { + if (len == -1LL) { printf(_("invalid length -- %s\n"), optarg); return 0; }