From: Collin Funk Date: Mon, 27 Oct 2025 02:06:08 +0000 (-0700) Subject: Linux: fix tst-copy_file_range-large test on 32-bit platforms. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3d20d746c3fc98092b364c198245ae7d2b81ac09;p=thirdparty%2Fglibc.git Linux: fix tst-copy_file_range-large test on 32-bit platforms. Since SSIZE_MAX is less than UINT_MAX on 32-bit platforms we must AND the expression with SSIZE_MAX. Tested on x86_64 and x86. Reviewed-by: H.J. Lu --- diff --git a/sysdeps/unix/sysv/linux/tst-copy_file_range-large.c b/sysdeps/unix/sysv/linux/tst-copy_file_range-large.c index 9eafb8c425..2ad679be6b 100644 --- a/sysdeps/unix/sysv/linux/tst-copy_file_range-large.c +++ b/sysdeps/unix/sysv/linux/tst-copy_file_range-large.c @@ -174,9 +174,11 @@ test_size (struct support_fuse *f, off64_t size) silently clamped to UINT_MAX & PAGE_MASK. Accept that return value too. See: . + We must AND the expression with SSIZE_MAX for 32-bit platforms where + SSIZE_MAX is less than UINT_MAX. */ if (copied != size) - TEST_COMPARE (copied, UINT_MAX & ~(getpagesize () - 1)); + TEST_COMPARE (copied, (UINT_MAX & ~(getpagesize () - 1)) & SSIZE_MAX); xclose (dest_fd); xclose (source_fd);