1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
Commit Graph

14 Commits

Author SHA1 Message Date
Andrew Bartlett
43e9be8894 build: Remove sys_lseek wrapper 2012-04-05 02:39:08 +02:00
Jeremy Allison
5e6263960a Third part of fix for bug #8679 - recvfile code path using splice() on Linux leaves data in the pipe on short write.
Fix default_sys_recvfile() to correctly cope with
short writes. Return the amount written. Return
-1 and set errno if no data could be written.
2011-12-30 20:45:10 -08:00
Jeremy Allison
a5715420e3 Second part of fix for bug #8679 - recvfile code path using splice() on Linux leaves data in the pipe on short write.
Split out the functionality of drain_socket() into a separate
function from default_sys_recvfile().
2011-12-30 20:23:00 -08:00
Jeremy Allison
eb617374a6 Fix bug #8679 - recvfile code path using splice() on Linux leaves data in the pipe on short write
Bug found and fix suggested by Andrew Bartlett.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Sun Dec 25 07:46:38 CET 2011 on sn-devel-104
2011-12-25 07:46:38 +01:00
Günther Deschner
0e771263ee s3-includes: only include system/filesys.h when needed.
Guenther
2011-03-30 01:13:07 +02:00
Volker Lendecke
e1459a2379 Several fixes to our use of splice
The splice manpage explicitly requires loff_t as offset. Copy "offset" there.
Probably not required, but I wanted to make sure it's as required.

Splice blocks with large buffers. For me it worked with 16k and blocked with
32k and beyond. It would be nice to see a clarification in the manpage of
splice for this behaviour.

Splice if used with an offset increments the offset. From the manpage this was
at least not entirely obvious :-)

I haven't yet activated this (try_splice_call ist still false by default), it
needs more testing.

Volker
2009-01-07 12:04:44 +01:00
Volker Lendecke
98f830cdfc Disable the use of splice(2)
On a debian lenny installation with a kernel that calls itself 2.6.28, I could
repeatably block smbd using splice. According to the output of netstat, the
recvq of the TCP connection was full and at the same time according to strace
smbd was stuck in a splice syscall trying to read from that TCP connection. We
can not protect ourselves from this condition, as nobody will ever notify us
that something is broken. So sadly we can't use splice yet at all. Maybe in
2.6.29...
2008-12-31 19:33:25 +01:00
Volker Lendecke
e0fd61f0cb Try to fix recvfile using splice on Linux
According to the splice(2) manpage, one of the file descriptors *must* be a
pipe. With this patch I could successfully run splice(2) on a debian lenny
installation.

Jeremy, please check!
2008-12-31 19:33:25 +01:00
Jeremy Allison
8ca459e067 Fix bug #5477 - recvfile code was broken.
Jeremy.
(This used to be commit 830337f054)
2008-05-20 12:09:48 -07:00
Jeremy Allison
82572cfd43 Enable tests for splice on Linux. Add a static (vl, I hate this)
so we can detect broken Linux recvfile splice and correctly fall
back.
Jeremy.
(This used to be commit ec2d301a7a)
2008-05-06 15:44:39 -07:00
Jeremy Allison
133fad90b5 Make explicit draining the socket on RECVFILE. Add
capability for large UNIX write if not signing and
recvfile set. Cope with large UNIX write length on
incoming processing. Stevef - we can now test 1-16Mb
writes from CIFFS.
Jeremy.
(This used to be commit 8cf78776b0)
2007-10-31 14:01:35 -07:00
Jeremy Allison
ff82c0a037 Handle the disk full error case correctly.
Jeremy.
(This used to be commit b7088bb9c2)
2007-10-30 18:18:40 -07:00
Jeremy Allison
c3250149e1 Add new parameter, "min receivefile size" (by default set
to zero). If non-zero, writeX calls greater than this
value will be left in the socket buffer for later handling
with recvfile (or userspace equivalent). Definition of
recvfile for your system is left as an exercise for
the reader (I'm working on getting splice working :-).
Jeremy.
(This used to be commit 11c03b75dd)
2007-10-30 16:22:24 -07:00
Jeremy Allison
0af071d762 Forgot to add recvfile.c
Jeremy.
(This used to be commit d5886218e5)
2007-10-29 17:17:16 -07:00