From 2f287538bfaf139fb319c732037bf1f9d63d7e50 Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Fri, 29 Nov 2024 14:06:39 +0100 Subject: [PATCH] s3/lib: use VFS_PWRITE_APPEND_OFFSET in default_sys_recvfile() 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 Reviewed-by: Jeremy Allison --- source3/lib/recvfile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source3/lib/recvfile.c b/source3/lib/recvfile.c index e1eb241d7bd..5adb3395989 100644 --- a/source3/lib/recvfile.c +++ b/source3/lib/recvfile.c @@ -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; -- 2.47.3