diff options
Diffstat (limited to 'fs/lockd/svc.c')
-rw-r--r-- | fs/lockd/svc.c | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/fs/lockd/svc.c b/fs/lockd/svc.c index 8ca18085e68d..80fcacc1acf9 100644 --- a/fs/lockd/svc.c +++ b/fs/lockd/svc.c | |||
@@ -141,6 +141,7 @@ lockd(struct svc_rqst *rqstp) | |||
141 | */ | 141 | */ |
142 | while ((nlmsvc_users || !signalled()) && nlmsvc_pid == current->pid) { | 142 | while ((nlmsvc_users || !signalled()) && nlmsvc_pid == current->pid) { |
143 | long timeout = MAX_SCHEDULE_TIMEOUT; | 143 | long timeout = MAX_SCHEDULE_TIMEOUT; |
144 | char buf[RPC_MAX_ADDRBUFLEN]; | ||
144 | 145 | ||
145 | if (signalled()) { | 146 | if (signalled()) { |
146 | flush_signals(current); | 147 | flush_signals(current); |
@@ -175,11 +176,10 @@ lockd(struct svc_rqst *rqstp) | |||
175 | break; | 176 | break; |
176 | } | 177 | } |
177 | 178 | ||
178 | dprintk("lockd: request from %08x\n", | 179 | dprintk("lockd: request from %s\n", |
179 | (unsigned)ntohl(rqstp->rq_addr.sin_addr.s_addr)); | 180 | svc_print_addr(rqstp, buf, sizeof(buf))); |
180 | 181 | ||
181 | svc_process(rqstp); | 182 | svc_process(rqstp); |
182 | |||
183 | } | 183 | } |
184 | 184 | ||
185 | flush_signals(current); | 185 | flush_signals(current); |
@@ -223,23 +223,29 @@ static int find_socket(struct svc_serv *serv, int proto) | |||
223 | return found; | 223 | return found; |
224 | } | 224 | } |
225 | 225 | ||
226 | /* | ||
227 | * Make any sockets that are needed but not present. | ||
228 | * If nlm_udpport or nlm_tcpport were set as module | ||
229 | * options, make those sockets unconditionally | ||
230 | */ | ||
226 | static int make_socks(struct svc_serv *serv, int proto) | 231 | static int make_socks(struct svc_serv *serv, int proto) |
227 | { | 232 | { |
228 | /* Make any sockets that are needed but not present. | 233 | static int warned; |
229 | * If nlm_udpport or nlm_tcpport were set as module | ||
230 | * options, make those sockets unconditionally | ||
231 | */ | ||
232 | static int warned; | ||
233 | int err = 0; | 234 | int err = 0; |
235 | |||
234 | if (proto == IPPROTO_UDP || nlm_udpport) | 236 | if (proto == IPPROTO_UDP || nlm_udpport) |
235 | if (!find_socket(serv, IPPROTO_UDP)) | 237 | if (!find_socket(serv, IPPROTO_UDP)) |
236 | err = svc_makesock(serv, IPPROTO_UDP, nlm_udpport); | 238 | err = svc_makesock(serv, IPPROTO_UDP, nlm_udpport, |
237 | if (err == 0 && (proto == IPPROTO_TCP || nlm_tcpport)) | 239 | SVC_SOCK_DEFAULTS); |
240 | if (err >= 0 && (proto == IPPROTO_TCP || nlm_tcpport)) | ||
238 | if (!find_socket(serv, IPPROTO_TCP)) | 241 | if (!find_socket(serv, IPPROTO_TCP)) |
239 | err= svc_makesock(serv, IPPROTO_TCP, nlm_tcpport); | 242 | err = svc_makesock(serv, IPPROTO_TCP, nlm_tcpport, |
240 | if (!err) | 243 | SVC_SOCK_DEFAULTS); |
244 | |||
245 | if (err >= 0) { | ||
241 | warned = 0; | 246 | warned = 0; |
242 | else if (warned++ == 0) | 247 | err = 0; |
248 | } else if (warned++ == 0) | ||
243 | printk(KERN_WARNING | 249 | printk(KERN_WARNING |
244 | "lockd_up: makesock failed, error=%d\n", err); | 250 | "lockd_up: makesock failed, error=%d\n", err); |
245 | return err; | 251 | return err; |