rpc.mountd: set nonblocking mode with libtirpc
Subsystems (2)
A message that is not in the archive (sent off-list or not yet received): [email protected]
NeilBrown
Reviewed-byQuoted 11 lines · On 05 Nov 2014 21:23:39 +0100 [email protected] wrote:
From: Bodo Stroesser <[email protected]>
Date: Thu, 09 Oct 2014 13:07:33 +0200
Subject: [nfs-utils] [PATCH 2/3] rpc.mountd: set nonblocking mode with libtirpcIf mountd is built with libtirpc the tcp listeners and the sockets waiting for UDP messages are not in non-blocking mode. Thus if running with multiple threads (-t XX), all threads will wake up from select on a connection request or a UDP message, but only one thread will succeed. All others will wait on
accept()orread()for the next event.Signed-off-by Bodo Stroesser <[email protected]>
The two changes provide identical functionality: one in
svc_create_nconf_rand_port
the other in
svc_create_nconf_fixed_port
We really do want non-blocking sockets here!
Thanks,
NeilBrown
Quoted 25 lines
---
support/nfs/svc_create.c +7
-0@@ -277,6 +277,12 @@ "(%s, %u, %s)", name, version, nconf->nc_netid);return 0 ; } +if (svcsock_nonblock (xprt->xp_fd) <0 ) { +/* close() already done by svcsock_nonblock() */ + xprt->xp_fd =RPC_ANYFD ; +SVC_DESTROY (xprt); +return 0 ; + }if (!svc_reg (xprt, program, version, dispatch, nconf)) {/* svc_reg(3) destroys @xprt in this case */ @@ -332,6 +338,7 @@int fd; fd =svc_create_sock (ai->ai_addr, ai->ai_addrlen, nconf); + fd =svcsock_nonblock (fd);if (fd ==-1 ) goto out_free;