diff options
-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. |