Solution to my read problem 'Broken pipe' 'write_socket_data'

Lei Zhang lzhang at
Tue Mar 6 03:18:14 GMT 2001


The only reason I use Samba is I want to connect my linux desktop with
my windows laptop and share the larger disk with the laptop. I got weird

problem that I could only write to the samba server but I could not read

from it with errors like:

[2001/03/04 16:36:38, 0] lib/util_sock.c:write_socket_data(540)
  write_socket_data: write failure. Error = Broken pipe
[2001/03/04 16:36:38, 6] lib/util_sock.c:write_socket(563)
  write_socket(10,61503) wrote -1
[2001/03/04 16:36:38, 0] lib/util_sock.c:write_socket(566)
  write_socket: Error writing 61503 bytes to socket 10: ERRNO = Broken
[2001/03/04 16:36:38, 0] lib/util_sock.c:send_smb(754)
  Error writing 61503 bytes to client. -1. Exiting

I tried some suggestions on name resolution but it did not work. I had
intranet  before which the name was totally controlled by my linux box,
so I doubted this was not the real reason for me. I finally recognized
it was problem with socket(mighte be obvious from the log, but who knows

it was the socket itself caused the problem) Actually I ran win98/w2k
using vmware and connected them to linux by host-only virtual network
and there was no problem on these two systems, and there was only read
problem, no write problem on the real network-linked windows system. I
reviewed the code, and it seemed to me that the reason for 'Broken pipe'

was from 'send' function called by write_socket_data, then I read
smb.conf, and I came across the following lines:

# Most people will find that this option gives better performance.
# See speed.txt and the manual pages for details
# Rather, the options do NOT work in some cases
   socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192

After several trials, I modified the socket options to:

 socket options = TCP_NODELAY SO_RCVBUF=8192
ie, simply deleted the SO_SNDBUF=8192

Then, everything works perfectly now!

I suggest that if anyone meets such 'write_sock_data', 'Broke pipe', etc

errors, try something on this command first, or use different network
interface to see if errors occur in that case.

with regards


More information about the samba mailing list