Lei Zhang
2001-Mar-06 03:18 UTC
Solution to my read problem 'Broken pipe' 'write_socket_data'
Hi, 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 pipe [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 Lei
MCCALL,DON (HP-USA,ex1)
2001-Mar-06 04:13 UTC
Solution to my read problem 'Broken pipe' 'write_socket_data'
Hi Lei, I had a similar problem on a port of 2.07 (and 2.2) to MPE/iX os. The maximum amount of data that the sockets implementation on MPE/iX could handle was 30,000, so I had to 'throttle' the write_socket_data() and read_socket_data() for only 30,000 bytes at a time. for read_socket_data() #ifdef mpeix if (N - total > 30000) ret = read(fd,buffer + total,30000); else #endif /* mpeix */ ... and for write_socket-data() #ifdef mpeix if (N - total > 30000) re ret = send(fd,buffer + total,30000,0); else #endif /* mpeix */ ... But I think this was an MPE/iX os specific problem, as I have never seen the need for this on HP-UX... Thanks for the tip! Don -----Original Message----- From: Lei Zhang [mailto:lzhang@colorado.edu] Sent: Monday, March 05, 2001 22:18 To: samba@us5.samba.org Cc: Dany; David Rankin Subject: Solution to my read problem 'Broken pipe' 'write_socket_data' Hi, 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 pipe [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 Lei -- To unsubscribe from this list go to the following URL and read the instructions: http://lists.samba.org/mailman/listinfo/samba
Urban Widmark
2001-Mar-06 08:57 UTC
Solution to my read problem 'Broken pipe' 'write_socket_data'
On Mon, 5 Mar 2001, Lei Zhang wrote:> # 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!(So it wasn't just me and my compilers then ...) Which kernel version do you run this on? I've seen this too, but I though it was a matter of me using broken compilers (RH7 gcc-2.96-54, -69 is supposedly better ...). I'd like some details on your setup (compilers used, glibc, kernel) and forward it to the proper authorities. It works fine for me on 2.2.19pre16 but it fails like this on 2.4.x, if and only if I have these *BUF settings. It doesn't matter which client I use, if something needs to send a lot of data (a long dir listing) it will hang. This is either a samba bug if you are not allowed to set a buffer size of 8192 and then attempt to send 60k of data, or it is a kernel bug where it doesn't handle this case. /Urban
Lei Zhang
2001-Mar-07 18:50 UTC
Solution to my read problem 'Broken pipe' 'write_socket_data'
Hi, Samba might be a victim in my case. I found similiar problem when I use OpenAFS client: I can not write big file to the file server. Fortunately, I did not dig into the source code of OpenAFS although the log showed that the problem was 'file server was down(back up)'. All in the box are so commonly used that I can not understand such bug or problem, the only thing in my linux machine uncommon is the FA311 NIC and its driver provided by NetGear. I viewed the code fa311.c and found that the code was for kernel v2.0.36. though NetGear claimed it was driver for rh 6.x. I did not try its beta driver for rh 7.0. There is good driver for fa311 from http://www.scyld.com/network/natsemi.html. I made the module. There is no problem with SO_SNDBUF=8192 parameter, or afs now. Hopefully, that's the end of the story.:) -- Lei -------------- next part -------------- HTML attachment scrubbed and removed