diff options
Diffstat (limited to 'fs/lockd/svc.c')
| -rw-r--r-- | fs/lockd/svc.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/fs/lockd/svc.c b/fs/lockd/svc.c index 470af0138bb5..08226464e563 100644 --- a/fs/lockd/svc.c +++ b/fs/lockd/svc.c | |||
| @@ -227,17 +227,25 @@ lockd(struct svc_rqst *rqstp) | |||
| 227 | static int make_socks(struct svc_serv *serv, int proto) | 227 | static int make_socks(struct svc_serv *serv, int proto) |
| 228 | { | 228 | { |
| 229 | static int warned; | 229 | static int warned; |
| 230 | struct svc_xprt *xprt; | ||
| 230 | int err = 0; | 231 | int err = 0; |
| 231 | 232 | ||
| 232 | if (proto == IPPROTO_UDP || nlm_udpport) | 233 | if (proto == IPPROTO_UDP || nlm_udpport) { |
| 233 | if (!svc_find_xprt(serv, "udp", 0, 0)) | 234 | xprt = svc_find_xprt(serv, "udp", 0, 0); |
| 235 | if (!xprt) | ||
| 234 | err = svc_create_xprt(serv, "udp", nlm_udpport, | 236 | err = svc_create_xprt(serv, "udp", nlm_udpport, |
| 235 | SVC_SOCK_DEFAULTS); | 237 | SVC_SOCK_DEFAULTS); |
| 236 | if (err >= 0 && (proto == IPPROTO_TCP || nlm_tcpport)) | 238 | else |
| 237 | if (!svc_find_xprt(serv, "tcp", 0, 0)) | 239 | svc_xprt_put(xprt); |
| 240 | } | ||
| 241 | if (err >= 0 && (proto == IPPROTO_TCP || nlm_tcpport)) { | ||
| 242 | xprt = svc_find_xprt(serv, "tcp", 0, 0); | ||
| 243 | if (!xprt) | ||
| 238 | err = svc_create_xprt(serv, "tcp", nlm_tcpport, | 244 | err = svc_create_xprt(serv, "tcp", nlm_tcpport, |
| 239 | SVC_SOCK_DEFAULTS); | 245 | SVC_SOCK_DEFAULTS); |
| 240 | 246 | else | |
| 247 | svc_xprt_put(xprt); | ||
| 248 | } | ||
| 241 | if (err >= 0) { | 249 | if (err >= 0) { |
| 242 | warned = 0; | 250 | warned = 0; |
| 243 | err = 0; | 251 | err = 0; |
