From: NeilBrown <neilb@suse.de>
To: bstroesser@ts.fujitsu.com
Cc: linux-nfs@vger.kernel.org, bfields@fieldses.org
Subject: Re: [nfs-utils] [PATCH 2/3] rpc.mountd: set nonblocking mode with libtirpc
Date: Thu, 6 Nov 2014 08:57:46 +1100 [thread overview]
Message-ID: <20141106085746.78f9f395@notabene.brown> (raw)
In-Reply-To: <61eb00$5diu13@dgate20u.abg.fsc.net>
[-- Attachment #1: Type: text/plain, Size: 1689 bytes --]
On 05 Nov 2014 21:23:39 +0100 bstroesser@ts.fujitsu.com wrote:
> From: Bodo Stroesser <bstroesser@ts.fujitsu.com>
> Date: Thu, 09 Oct 2014 13:07:33 +0200
> Subject: [nfs-utils] [PATCH 2/3] rpc.mountd: set nonblocking mode with libtirpc
>
> If 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() or read() for the next event.
>
> Signed-off-by: Bodo Stroesser <bstroesser@ts.fujitsu.com>
Reviewed-by: NeilBrown <neilb@suse.de>
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
> ---
>
> --- nfs-utils-1.3.1/support/nfs/svc_create.c 2014-10-08 21:39:01.000000000 +0200
> +++ nfs-utils-1.3.1/support/nfs/svc_create.c 2014-10-08 22:20:02.000000000 +0200
> @@ -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;
>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 811 bytes --]
next parent reply other threads:[~2014-11-05 21:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <61eb00$5diu13@dgate20u.abg.fsc.net>
2014-11-05 21:57 ` NeilBrown [this message]
2014-11-05 20:23 [nfs-utils] [PATCH 2/3] rpc.mountd: set nonblocking mode with libtirpc bstroesser
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20141106085746.78f9f395@notabene.brown \
--to=neilb@suse.de \
--cc=bfields@fieldses.org \
--cc=bstroesser@ts.fujitsu.com \
--cc=linux-nfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox