From: Chuck Lever Subject: Re: [PATCH] NLM: Revert parts of commit 24e36663 Date: Fri, 26 Sep 2008 13:53:58 -0400 Message-ID: References: <20080924184732.4078.83334.stgit@tarkus.1015granger.net> <20080925213831.GF14349@fieldses.org> Mime-Version: 1.0 (Apple Message framework v929.2) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Cc: trond.myklebust@netapp.com, linux-nfs@vger.kernel.org To: "J. Bruce Fields" Return-path: Received: from rgminet01.oracle.com ([148.87.113.118]:46810 "EHLO rgminet01.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752209AbYIZRyS (ORCPT ); Fri, 26 Sep 2008 13:54:18 -0400 In-Reply-To: <20080925213831.GF14349@fieldses.org> Sender: linux-nfs-owner@vger.kernel.org List-ID: On Sep 25, 2008, at Sep 25, 2008, 5:38 PM, J. Bruce Fields wrote: > On Wed, Sep 24, 2008 at 02:50:36PM -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 >> --- >> >> I currently have this workaround lurking in my git repo. Is there >> some kind >> of fix for this issue planned for 2.6.28? > > Not that I know of. > >> This is only a reminder, not a suggested patch. > > Any chance you could generate a patch? I can, but no guarantee it will be in time for the 2.6.28 merge window. Would we consider this a regression fix? If so, we could post it after the merge window closes. It would give a little more time to do some testing. >> 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; >> >> /* >> -- Chuck Lever chuck[dot]lever[at]oracle[dot]com