diff options
author | NeilBrown <neilb@suse.de> | 2006-10-02 05:17:52 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-02 10:57:18 -0400 |
commit | 7dcf91ec6698fe8564ad91bbe42740aacaa0d9ee (patch) | |
tree | 65c5406dffd6a12c2ae7a26fc59448163cc3f78e /fs | |
parent | 3dfb4210535303bb4c2e0ff1c4fdd4dfe9b93472 (diff) |
[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: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/lockd/svc.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/fs/lockd/svc.c b/fs/lockd/svc.c index f0791cff45ac..448768b52913 100644 --- a/fs/lockd/svc.c +++ b/fs/lockd/svc.c | |||
@@ -227,15 +227,19 @@ static int make_socks(struct svc_serv *serv, int proto) | |||
227 | * If nlm_udpport or nlm_tcpport were set as module | 227 | * If nlm_udpport or nlm_tcpport were set as module |
228 | * options, make those sockets unconditionally | 228 | * options, make those sockets unconditionally |
229 | */ | 229 | */ |
230 | static int warned; | ||
230 | int err = 0; | 231 | int err = 0; |
231 | if (proto == IPPROTO_UDP || nlm_udpport) | 232 | if (proto == IPPROTO_UDP || nlm_udpport) |
232 | if (!find_socket(serv, IPPROTO_UDP)) | 233 | if (!find_socket(serv, IPPROTO_UDP)) |
233 | err = svc_makesock(serv, IPPROTO_UDP, nlm_udpport); | 234 | err = svc_makesock(serv, IPPROTO_UDP, nlm_udpport); |
234 | if (err) | 235 | if (err == 0 && (proto == IPPROTO_TCP || nlm_tcpport)) |
235 | return err; | ||
236 | if (proto == IPPROTO_TCP || nlm_tcpport) | ||
237 | if (!find_socket(serv, IPPROTO_TCP)) | 236 | if (!find_socket(serv, IPPROTO_TCP)) |
238 | err= svc_makesock(serv, IPPROTO_TCP, nlm_tcpport); | 237 | err= svc_makesock(serv, IPPROTO_TCP, nlm_tcpport); |
238 | if (!err) | ||
239 | warned = 0; | ||
240 | else if (warned++ == 0) | ||
241 | printk(KERN_WARNING | ||
242 | "lockd_up: makesock failed, error=%d\n", err); | ||
239 | return err; | 243 | return err; |
240 | } | 244 | } |
241 | 245 | ||
@@ -245,7 +249,6 @@ static int make_socks(struct svc_serv *serv, int proto) | |||
245 | int | 249 | int |
246 | lockd_up(int proto) /* Maybe add a 'family' option when IPv6 is supported ?? */ | 250 | lockd_up(int proto) /* Maybe add a 'family' option when IPv6 is supported ?? */ |
247 | { | 251 | { |
248 | static int warned; | ||
249 | struct svc_serv * serv; | 252 | struct svc_serv * serv; |
250 | int error = 0; | 253 | int error = 0; |
251 | 254 | ||
@@ -278,13 +281,8 @@ lockd_up(int proto) /* Maybe add a 'family' option when IPv6 is supported ?? */ | |||
278 | goto out; | 281 | goto out; |
279 | } | 282 | } |
280 | 283 | ||
281 | if ((error = make_socks(serv, proto)) < 0) { | 284 | if ((error = make_socks(serv, proto)) < 0) |
282 | if (warned++ == 0) | ||
283 | printk(KERN_WARNING | ||
284 | "lockd_up: makesock failed, error=%d\n", error); | ||
285 | goto destroy_and_out; | 285 | goto destroy_and_out; |
286 | } | ||
287 | warned = 0; | ||
288 | 286 | ||
289 | /* | 287 | /* |
290 | * Create the kernel thread and wait for it to start. | 288 | * Create the kernel thread and wait for it to start. |