]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3/lib: use VFS_PWRITE_APPEND_OFFSET in default_sys_recvfile()
authorRalph Boehme <slow@samba.org>
Fri, 29 Nov 2024 13:06:39 +0000 (14:06 +0100)
committerJeremy Allison <jra@samba.org>
Tue, 7 Jan 2025 22:04:33 +0000 (22:04 +0000)
Note that splice() itself doesn't work with an O_APPEND outfd:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=efc968d450e013049a662d22727cf132618dcb2f

Hence for the real splice() codepath itself no changes are needed, as splice
will just fail with EINVAL triggering the fallback code.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/lib/recvfile.c

index e1eb241d7bd8ce168443882d3cc7cad145cb6590..5adb3395989db60bc08bdcb8b660b483ed7a8ca6 100644 (file)
@@ -63,7 +63,7 @@ static ssize_t default_sys_recvfile(int fromfd,
                return 0;
        }
 
-       if (tofd != -1 && offset != (off_t)-1) {
+       if (tofd != -1 && offset != (off_t)VFS_PWRITE_APPEND_OFFSET) {
                if (lseek(tofd, offset, SEEK_SET) == -1) {
                        if (errno != ESPIPE) {
                                return -1;