提交 7dcf91ec 编写于 作者: N NeilBrown 提交者: Linus Torvalds

[PATCH] knfsd: Move makesock failed warning into make_socks.

Thus it is printed for any path that leads to failure (make_socks is called
from two places).

Cc: "J. Bruce Fields" <bfields@fieldses.org>
Signed-off-by: NNeil Brown <neilb@suse.de>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 3dfb4210
...@@ -227,15 +227,19 @@ static int make_socks(struct svc_serv *serv, int proto) ...@@ -227,15 +227,19 @@ static int make_socks(struct svc_serv *serv, int proto)
* If nlm_udpport or nlm_tcpport were set as module * If nlm_udpport or nlm_tcpport were set as module
* options, make those sockets unconditionally * options, make those sockets unconditionally
*/ */
static int warned;
int err = 0; int err = 0;
if (proto == IPPROTO_UDP || nlm_udpport) if (proto == IPPROTO_UDP || nlm_udpport)
if (!find_socket(serv, IPPROTO_UDP)) if (!find_socket(serv, IPPROTO_UDP))
err = svc_makesock(serv, IPPROTO_UDP, nlm_udpport); err = svc_makesock(serv, IPPROTO_UDP, nlm_udpport);
if (err) if (err == 0 && (proto == IPPROTO_TCP || nlm_tcpport))
return err;
if (proto == IPPROTO_TCP || nlm_tcpport)
if (!find_socket(serv, IPPROTO_TCP)) if (!find_socket(serv, IPPROTO_TCP))
err= svc_makesock(serv, IPPROTO_TCP, nlm_tcpport); err= svc_makesock(serv, IPPROTO_TCP, nlm_tcpport);
if (!err)
warned = 0;
else if (warned++ == 0)
printk(KERN_WARNING
"lockd_up: makesock failed, error=%d\n", err);
return err; return err;
} }
...@@ -245,7 +249,6 @@ static int make_socks(struct svc_serv *serv, int proto) ...@@ -245,7 +249,6 @@ static int make_socks(struct svc_serv *serv, int proto)
int int
lockd_up(int proto) /* Maybe add a 'family' option when IPv6 is supported ?? */ lockd_up(int proto) /* Maybe add a 'family' option when IPv6 is supported ?? */
{ {
static int warned;
struct svc_serv * serv; struct svc_serv * serv;
int error = 0; int error = 0;
...@@ -278,13 +281,8 @@ lockd_up(int proto) /* Maybe add a 'family' option when IPv6 is supported ?? */ ...@@ -278,13 +281,8 @@ lockd_up(int proto) /* Maybe add a 'family' option when IPv6 is supported ?? */
goto out; goto out;
} }
if ((error = make_socks(serv, proto)) < 0) { if ((error = make_socks(serv, proto)) < 0)
if (warned++ == 0)
printk(KERN_WARNING
"lockd_up: makesock failed, error=%d\n", error);
goto destroy_and_out; goto destroy_and_out;
}
warned = 0;
/* /*
* Create the kernel thread and wait for it to start. * Create the kernel thread and wait for it to start.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册