From 5b6ba1d246cd7ce6ec776f4c51a29f2af78bfda6 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Wed, 18 Jun 2008 09:54:38 +0000 Subject: [PATCH] Added error message for a kernel bug, which doesn't allow for poll() to work with >256 file descriptors and prevents iscsi-scstd to start. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@416 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- iscsi-scst/usr/iscsi_scstd.c | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/iscsi-scst/usr/iscsi_scstd.c b/iscsi-scst/usr/iscsi_scstd.c index 465455579..b1ef68e56 100644 --- a/iscsi-scst/usr/iscsi_scstd.c +++ b/iscsi-scst/usr/iscsi_scstd.c @@ -466,11 +466,26 @@ static void event_loop(int timeout) isns_handle(1, &timeout); continue; } else if (res < 0) { - if (res < 0 && errno != EINTR) { - log_error("%s:poll() %d", __FUNCTION__, errno); - exit(1); - } - continue; + if (errno == EINTR) + continue; + else if (errno == EINVAL) + log_error("%s: poll() failed with EINVAL. Should " + "you increase RLIMIT_NOFILE (ulimit -n)? " + "Or upgrade your kernel? Kernels below 2.6.19 " + "have a bug, which doesn't allow poll() " + "to work with >256 file descriptors. See " + "http://sourceforge.net/mailarchive/forum.php?" + "thread_name=9392A06CB0FDC847B3A530B3DC174E7B0" + "55F1EF3%40mse10be1.mse10.exchange.ms&forum_" + "name=scst-devel for more details. Alternatively, " + "you can desrease iscsi_scstd.c::INCOMING_MAX " + "constant to a lower value, e.g. 128, then " + "recompile and reinstall the user space part " + "of iSCSI-SCST.", __FUNCTION__); + else + log_error("%s: poll() failed: %s", __FUNCTION__, + strerror(errno)); + exit(1); } for (i = 0; i < LISTEN_MAX; i++) {