Has anyone seen writev on FreeBSD return EINVAL after a write to a socket even though the data has hit the wire?

Volker Lendecke Volker.Lendecke at SerNet.DE
Thu May 2 02:38:56 MDT 2013


On Wed, May 01, 2013 at 08:52:52PM -0700, Richard Sharpe wrote:
> I am seeing a problem with SMB2 and writev's of responses, usually
> large responses, like a 64kiB read response. writev is returning
> EINVAL even though the data has actually hit the wire. I have verified
> this by looking at the capture and comparing the SMB sequence number
> in the header of the packet on the wire with what is in memory pointed
> to by the iovec sent to writev.

All the EINVAL conditions listed in the manpage point at
very strange conditions like rogue pointers and overly large
buffer sizes or so. If you have verified with a debugger
that we did not send garbage to the kernel, maybe the only
way out is to avoid using writev on FreeBSD. You can always
do TCP_CORK, do individual syscalls and TCP_UNCORK again.
You can also copy together the data in user space and see
if it works around this issue. That should just be for a
test environment, probably it will cost you performance.

With best regards,

Volker Lendecke

-- 
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de, mailto:kontakt at sernet.de


More information about the samba-technical mailing list