summaryrefslogtreecommitdiffstats
path: root/utils/mountd/svc_run.c
diff options
context:
space:
mode:
authorNeil Brown <neilb@suse.de>2007-03-19 11:12:34 +1100
committerNeil Brown <neilb@suse.de>2007-03-19 11:12:34 +1100
commit97ccd3d1b61f20cd681a82089e83c58f97438f1a (patch)
tree2703d4726975be2ab7c6f74dac64affaa6e9c469 /utils/mountd/svc_run.c
parentcb2342b123ded9f074345e15e5ffc0dbfeb095e0 (diff)
downloadnfs-utils-97ccd3d1b61f20cd681a82089e83c58f97438f1a.tar.gz
nfs-utils-97ccd3d1b61f20cd681a82089e83c58f97438f1a.tar.xz
nfs-utils-97ccd3d1b61f20cd681a82089e83c58f97438f1a.zip
Work around svc_getreqset in glibc 3
Without this fix, mountd ignores sockets with filedescriptor > 31, so if there are more than about 26 concurrent connections, mountd starts spinning.
Diffstat (limited to 'utils/mountd/svc_run.c')
-rw-r--r--utils/mountd/svc_run.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/utils/mountd/svc_run.c b/utils/mountd/svc_run.c
index 7a8a595..422e839 100644
--- a/utils/mountd/svc_run.c
+++ b/utils/mountd/svc_run.c
@@ -57,6 +57,32 @@
void cache_set_fds(fd_set *fdset);
int cache_process_req(fd_set *readfds);
+#if LONG_MAX != INT_MAX
+/* bug in glibc 2.3.6 and earlier, we need
+ * our own svc_getreqset
+ */
+static void
+my_svc_getreqset (fd_set *readfds)
+{
+ fd_mask mask;
+ fd_mask *maskp;
+ int setsize;
+ int sock;
+ int bit;
+
+ setsize = _rpc_dtablesize ();
+ if (setsize > FD_SETSIZE)
+ setsize = FD_SETSIZE;
+ maskp = readfds->fds_bits;
+ for (sock = 0; sock < setsize; sock += NFDBITS)
+ for (mask = *maskp++;
+ (bit = ffsl (mask));
+ mask ^= (1L << (bit - 1)))
+ svc_getreq_common (sock + bit - 1);
+}
+#define svc_getreqset my_svc_getreqset
+
+#endif
/*
* The heart of the server. A crib from libc for the most part...