From: Trond Myklebust <Trond.Myklebust@netapp.com>
To: Chuck Lever <chuck.lever@oracle.com>
Cc: bfields@fieldses.org, linux-nfs@vger.kernel.org
Subject: Re: [PATCH] NLM: Revert parts of commit 24e36663
Date: Wed, 24 Sep 2008 14:54:56 -0400 [thread overview]
Message-ID: <1222282496.7390.39.camel@localhost> (raw)
In-Reply-To: <20080924184732.4078.83334.stgit-lQeC5l55kZ7wdl/1UfZZQIVfYA8g3rJ/@public.gmane.org>
On Wed, 2008-09-24 at 14:50 -0400, Chuck Lever wrote:
> statd and some servers always need lockd to listen on UDP, so always
> start both lockd listener sockets.
>
> This probably leaks an svc_serv if the TCP listener can't be created,
> but it will do for now.
>
> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
ACK. We need this also in order to deal with servers that only send NLM
callbacks on UDP (yeah, I know that's lame...).
Trond
> ---
>
> I currently have this workaround lurking in my git repo. Is there some kind
> of fix for this issue planned for 2.6.28?
>
> This is only a reminder, not a suggested patch.
>
> fs/lockd/svc.c | 31 +++++++++++++------------------
> 1 files changed, 13 insertions(+), 18 deletions(-)
>
> diff --git a/fs/lockd/svc.c b/fs/lockd/svc.c
> index a7b604c..36b6d03 100644
> --- a/fs/lockd/svc.c
> +++ b/fs/lockd/svc.c
> @@ -213,25 +213,23 @@ lockd(void *vrqstp)
> }
>
> /*
> - * Make any sockets that are needed but not present.
> - * If nlm_udpport or nlm_tcpport were set as module
> - * options, make those sockets unconditionally
> + * Create UDP and TCP listeners for lockd. Even if we only
> + * have TCP NFS mounts and TCP NFSDs, some services (such
> + * as rpc.statd) still require UDP.
> */
> -static int make_socks(struct svc_serv *serv, const unsigned short proto)
> +static int make_socks(struct svc_serv *serv)
> {
> static int warned;
> struct svc_xprt *xprt;
> int err = 0;
>
> - if (proto == IPPROTO_UDP || nlm_udpport) {
> - xprt = svc_find_xprt(serv, "udp", 0, 0);
> - if (!xprt)
> - err = svc_create_xprt(serv, "udp", nlm_udpport,
> - SVC_SOCK_DEFAULTS);
> - else
> - svc_xprt_put(xprt);
> - }
> - if (err >= 0 && (proto == IPPROTO_TCP || nlm_tcpport)) {
> + xprt = svc_find_xprt(serv, "udp", 0, 0);
> + if (!xprt)
> + err = svc_create_xprt(serv, "udp", nlm_udpport,
> + SVC_SOCK_DEFAULTS);
> + else
> + svc_xprt_put(xprt);
> + if (err >= 0) {
> xprt = svc_find_xprt(serv, "tcp", 0, 0);
> if (!xprt)
> err = svc_create_xprt(serv, "tcp", nlm_tcpport,
> @@ -260,11 +258,8 @@ int lockd_up(const unsigned short proto)
> /*
> * Check whether we're already up and running.
> */
> - if (nlmsvc_rqst) {
> - if (proto)
> - error = make_socks(nlmsvc_rqst->rq_server, proto);
> + if (nlmsvc_rqst)
> goto out;
> - }
>
> /*
> * Sanity check: if there's no pid,
> @@ -281,7 +276,7 @@ int lockd_up(const unsigned short proto)
> goto out;
> }
>
> - if ((error = make_socks(serv, proto)) < 0)
> + if ((error = make_socks(serv)) < 0)
> goto destroy_and_out;
>
> /*
>
--
Trond Myklebust
Linux NFS client maintainer
NetApp
Trond.Myklebust@netapp.com
www.netapp.com
next prev parent reply other threads:[~2008-09-24 18:55 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-24 18:50 [PATCH] NLM: Revert parts of commit 24e36663 Chuck Lever
[not found] ` <20080924184732.4078.83334.stgit-lQeC5l55kZ7wdl/1UfZZQIVfYA8g3rJ/@public.gmane.org>
2008-09-24 18:54 ` Trond Myklebust [this message]
2008-09-26 15:50 ` Talpey, Thomas
2008-09-25 21:38 ` J. Bruce Fields
2008-09-26 17:53 ` Chuck Lever
2008-09-26 18:45 ` J. Bruce Fields
2008-09-26 18:49 ` Trond Myklebust
2008-09-26 18:51 ` J. Bruce Fields
2008-09-26 19:04 ` Chuck Lever
2008-09-26 19:11 ` Trond Myklebust
2008-09-26 19:44 ` J. Bruce Fields
2008-09-26 19:54 ` Chuck Lever
2008-09-26 19:57 ` Trond Myklebust
2008-09-26 21:11 ` Chuck Lever
2008-09-26 22:22 ` Trond Myklebust
2008-09-26 23:30 ` J. Bruce Fields
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=1222282496.7390.39.camel@localhost \
--to=trond.myklebust@netapp.com \
--cc=bfields@fieldses.org \
--cc=chuck.lever@oracle.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