aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/lockd/clntlock.c2
-rw-r--r--fs/lockd/svc.c12
-rw-r--r--fs/nfsd/nfssvc.c16
3 files changed, 16 insertions, 14 deletions
diff --git a/fs/lockd/clntlock.c b/fs/lockd/clntlock.c
index 6abb465b650f..87e1d03e8267 100644
--- a/fs/lockd/clntlock.c
+++ b/fs/lockd/clntlock.c
@@ -202,7 +202,7 @@ reclaimer(void *ptr)
202 /* This one ensures that our parent doesn't terminate while the 202 /* This one ensures that our parent doesn't terminate while the
203 * reclaim is in progress */ 203 * reclaim is in progress */
204 lock_kernel(); 204 lock_kernel();
205 lockd_up(0); 205 lockd_up(0); /* note: this cannot fail as lockd is already running */
206 206
207 nlmclnt_prepare_reclaim(host); 207 nlmclnt_prepare_reclaim(host);
208 /* First, reclaim all locks that have been marked. */ 208 /* First, reclaim all locks that have been marked. */
diff --git a/fs/lockd/svc.c b/fs/lockd/svc.c
index 448768b52913..3cc369e5693f 100644
--- a/fs/lockd/svc.c
+++ b/fs/lockd/svc.c
@@ -254,15 +254,11 @@ lockd_up(int proto) /* Maybe add a 'family' option when IPv6 is supported ?? */
254 254
255 mutex_lock(&nlmsvc_mutex); 255 mutex_lock(&nlmsvc_mutex);
256 /* 256 /*
257 * Unconditionally increment the user count ... this is
258 * the number of clients who _want_ a lockd process.
259 */
260 nlmsvc_users++;
261 /*
262 * Check whether we're already up and running. 257 * Check whether we're already up and running.
263 */ 258 */
264 if (nlmsvc_pid) { 259 if (nlmsvc_pid) {
265 error = make_socks(nlmsvc_serv, proto); 260 if (proto)
261 error = make_socks(nlmsvc_serv, proto);
266 goto out; 262 goto out;
267 } 263 }
268 264
@@ -270,7 +266,7 @@ lockd_up(int proto) /* Maybe add a 'family' option when IPv6 is supported ?? */
270 * Sanity check: if there's no pid, 266 * Sanity check: if there's no pid,
271 * we should be the first user ... 267 * we should be the first user ...
272 */ 268 */
273 if (nlmsvc_users > 1) 269 if (nlmsvc_users)
274 printk(KERN_WARNING 270 printk(KERN_WARNING
275 "lockd_up: no pid, %d users??\n", nlmsvc_users); 271 "lockd_up: no pid, %d users??\n", nlmsvc_users);
276 272
@@ -302,6 +298,8 @@ lockd_up(int proto) /* Maybe add a 'family' option when IPv6 is supported ?? */
302destroy_and_out: 298destroy_and_out:
303 svc_destroy(serv); 299 svc_destroy(serv);
304out: 300out:
301 if (!error)
302 nlmsvc_users++;
305 mutex_unlock(&nlmsvc_mutex); 303 mutex_unlock(&nlmsvc_mutex);
306 return error; 304 return error;
307} 305}
diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c
index f1314c63e823..cdec3993e0d5 100644
--- a/fs/nfsd/nfssvc.c
+++ b/fs/nfsd/nfssvc.c
@@ -221,18 +221,22 @@ static int nfsd_init_socks(int port)
221 if (!list_empty(&nfsd_serv->sv_permsocks)) 221 if (!list_empty(&nfsd_serv->sv_permsocks))
222 return 0; 222 return 0;
223 223
224 error = svc_makesock(nfsd_serv, IPPROTO_UDP, port);
225 if (error < 0)
226 return error;
227 error = lockd_up(IPPROTO_UDP); 224 error = lockd_up(IPPROTO_UDP);
225 if (error >= 0) {
226 error = svc_makesock(nfsd_serv, IPPROTO_UDP, port);
227 if (error < 0)
228 lockd_down();
229 }
228 if (error < 0) 230 if (error < 0)
229 return error; 231 return error;
230 232
231#ifdef CONFIG_NFSD_TCP 233#ifdef CONFIG_NFSD_TCP
232 error = svc_makesock(nfsd_serv, IPPROTO_TCP, port);
233 if (error < 0)
234 return error;
235 error = lockd_up(IPPROTO_TCP); 234 error = lockd_up(IPPROTO_TCP);
235 if (error >= 0) {
236 error = svc_makesock(nfsd_serv, IPPROTO_TCP, port);
237 if (error < 0)
238 lockd_down();
239 }
236 if (error < 0) 240 if (error < 0)
237 return error; 241 return error;
238#endif 242#endif