diff options
author | Collin Funk <collin.funk1@gmail.com> | 2025-09-27 17:28:47 -0700 |
---|---|---|
committer | Collin Funk <collin.funk1@gmail.com> | 2025-09-27 18:18:04 -0700 |
commit | e7eadbb29fc54d8f450d3b0bc51814e9948a0e0d (patch) | |
tree | 868798ba56278827dcd375e55a43551a35e87431 /sysdeps/unix/sysv/linux/tst-copy_file_range-large.c | |
parent | 653e6c4fffe31938239c5fd15ba26fbb23870d2e (diff) | |
download | glibc-master.zip glibc-master.tar.gz glibc-master.tar.bz2 |
Instead of a negative return value the fixed FUSE copy_file_range will
silently truncate the size to UINT_MAX & PAGE_MASK [1]. Allow that value
to be returned as well.
[1] https://github.com/torvalds/linux/commit/1e08938c3694f707bb165535df352ac97a8c75c9
Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
Diffstat (limited to 'sysdeps/unix/sysv/linux/tst-copy_file_range-large.c')
-rw-r--r-- | sysdeps/unix/sysv/linux/tst-copy_file_range-large.c | 8 |
1 files changed, 7 insertions, 1 deletions
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 14fdf82..9eafb8c 100644 --- a/sysdeps/unix/sysv/linux/tst-copy_file_range-large.c +++ b/sysdeps/unix/sysv/linux/tst-copy_file_range-large.c @@ -170,7 +170,13 @@ test_size (struct support_fuse *f, off64_t size) FAIL_UNSUPPORTED ("copy_file_range not supported"); } - TEST_COMPARE (copied, size); + /* To avoid the negative return value in Linux versions 6.18 the size is + silently clamped to UINT_MAX & PAGE_MASK. Accept that return value + too. See: + <https://github.com/torvalds/linux/commit/1e08938c3694f707bb165535df352ac97a8c75c9>. + */ + if (copied != size) + TEST_COMPARE (copied, UINT_MAX & ~(getpagesize () - 1)); xclose (dest_fd); xclose (source_fd); |