[PATCH] Graceful handling of pipe() failure

Marc VanHeyningen marc.vanheyningen at isilon.com
Wed Jun 25 21:04:31 GMT 2008

When a system is under load and low on resources, sometimes new child
smbd processes are unable to create the pipe used in sys_select() for
signaling.  Unfortunately, when this happens the code just calls
smb_panic().  This does clearly indicate where the problem is, but
dumping core seems a bit drastic.

This proposed patch makes sys_select() instead log and return an error
in this case.  I also audited the other places in the code where
sys_select() is called and added error handling to one, in
open_sockets_smbd(), so that it will bail instead of going into a tight
busy loop in the (unlikely) event that pipe() fails here.

Marc @ Isilon
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0765-Graceful-handling-of-pipe-failure.patch
Type: application/octet-stream
Size: 1469 bytes
Desc: 0765-Graceful-handling-of-pipe-failure.patch
Url : http://lists.samba.org/archive/samba-technical/attachments/20080625/197b1eb3/0765-Graceful-handling-of-pipe-failure.obj

More information about the samba-technical mailing list