diff options
| author | Rick Macklem <rmacklem@FreeBSD.org> | 2025-08-09 21:15:07 +0000 |
|---|---|---|
| committer | Rick Macklem <rmacklem@FreeBSD.org> | 2025-08-23 21:22:14 +0000 |
| commit | 2fd0083fcc23f4c25860b8890292448720a5961c (patch) | |
| tree | 50e963db1a1bd8dab12de69f0bf9e8eca82288dd /bin | |
| parent | 248daca0b3c3bd411a4629047e21cc03532890c0 (diff) | |
vfs_syscalls.c: Fix handling of offset args for copy_file_range
Commit 197997a broke handling of the offset
arguments to copy_file_range() when specified non-NULL.
The code fails to update the offsets and, as such, a loop like:
do {
len = copy_file_range(infd, &inpos, outfd, &outpos,
SSIZE_MAX, 0);
} while (len > 0);
becomes an infinite loop, just doing the same copy over and
over again.
This patch fixes it.
The clause "(foffsets_locked || foffsets_set)" in the if is not
actually needed for correctness, but I thought it made the code
a little more readable and might avoid some static
analyzer from throwing a "used before being set" for
the savinoff and savoutoff variables.
(cherry picked from commit 4046ad6bb0ee542a42d89a48a7d6a56564ed7f33)
Diffstat (limited to 'bin')
0 files changed, 0 insertions, 0 deletions
