Andrea Battaglia
2006-Jun-14 15:14 UTC
[Samba] Samba write errors, broken pipes and client lockups
Over the last few weeks I've had problems using Samba on a FreeBSD. Windows XP clients (that's all I have) would experience intermittent long delays (lockups, freezing) when accessing the samba shares using Windows Explorer or any other applications. This occurred both directly when browsing the network neighborhood, and when accessing the share through a letter drive mapping. Here's a snippet of my log file showing the smbd errors: Jun 13 17:41:04 foobar smbd[544]: [2006/06/13 17:41:04, 0] lib/util_sock.c:read_data(529) Jun 13 17:41:04 foobar kernel: Jun 13 17:41:04 foobar smbd[544]: [2006/06/13 17:41:04, 0] lib/util_sock.c:read_data(529) Jun 13 17:41:04 foobar smbd[544]: read_data: read failure for 4 bytes to client 192.168.0.108. Error = Operation timed out Jun 13 17:41:04 foobar kernel: Jun 13 17:41:04 foobar smbd[544]: read_data: read failure for 4 bytes to client 192.168.0.108. Error Operation timed out Jun 13 17:41:04 foobar smbd[544]: [2006/06/13 17:41:04, 0] lib/util_sock.c:write_data(557) Jun 13 17:41:04 foobar kernel: Jun 13 17:41:04 foobar smbd[544]: [2006/06/13 17:41:04, 0] lib/util_sock.c:write_data(557) Jun 13 17:41:04 foobar smbd[544]: write_data: write failure in writing to client 192.168.0.108. Error Broken pipe Jun 13 17:41:04 foobar kernel: Jun 13 17:41:04 foobar smbd[544]: write_data: write failure in writing to client 192.168.0.108. Error Broken pipe Jun 13 17:41:04 foobar smbd[544]: [2006/06/13 17:41:04, 0] lib/util_sock.c:send_smb(765) Jun 13 17:41:04 foobar kernel: Jun 13 17:41:04 foobar smbd[544]: [2006/06/13 17:41:04, 0] lib/util_sock.c:send_smb(765) Jun 13 17:41:04 foobar smbd[544]: Error writing 75 bytes to client. -1. (Broken pipe) Jun 13 17:41:04 foobar kernel: Jun 13 17:41:04 foobar smbd[544]: Error writing 75 bytes to client. -1. (Broken pipe) For a short while, the XP clients were also experiencing problems with mapped drive letters not reconnecting or losing their connection. This dialog would appear: An error occurred while reconnecting G: to \\foobar\folder. Microsoft Windows Network: The local device name is already in use. The connection has not been restored. I came across this posting http://lists.freebsd.org/pipermail/freebsd-ipfw/2005-July/001925.html and added some logging to my ipfw firewall, which showed that some packets coming from the clients to port 445 were being denied by a rule with the 'established' option.. I removed the rule with the ipfw established option. This corrected all the symptoms I indicated above. # This rule causes problems with Windows Networking clients # ipfw -q add 00235 deny log tcp from any to any in established System info... FreeBSD 6.1-RELEASE GENERIC i386 samba-3.0.22,1 A free SMB and CIFS client and server for UNIX Andy