Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 114345
b: refs/heads/master
c: 8c3916f
h: refs/heads/master
i:
  114343: e9a2bfd
v: v3
  • Loading branch information
Chuck Lever authored and J. Bruce Fields committed Oct 4, 2008
1 parent b300ee8 commit 9a8b485
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 19 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9a38a83880c224c6a3fd973ac9ae30a043487f0f
refs/heads/master: 8c3916f4bdf9c8388bd70d0b399b3a43daf2087a
37 changes: 19 additions & 18 deletions trunk/fs/lockd/svc.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,25 +189,28 @@ 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
* Ensure there are active UDP and TCP listeners for lockd.
*
* Even if we have only TCP NFS mounts and/or TCP NFSDs, some
* local services (such as rpc.statd) still require UDP, and
* some NFS servers do not yet support NLM over TCP.
*
* Returns zero if all listeners are available; otherwise a
* negative errno value is returned.
*/
static int make_socks(struct svc_serv *serv, int 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,
Expand Down Expand Up @@ -237,11 +240,8 @@ lockd_up(int proto) /* Maybe add a 'family' option when IPv6 is supported ?? */
/*
* 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,
Expand All @@ -258,7 +258,8 @@ lockd_up(int proto) /* Maybe add a 'family' option when IPv6 is supported ?? */
goto out;
}

if ((error = make_socks(serv, proto)) < 0)
error = make_socks(serv);
if (error < 0)
goto destroy_and_out;

/*
Expand Down

0 comments on commit 9a8b485

Please sign in to comment.