Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 309795
b: refs/heads/master
c: e3f70ea
h: refs/heads/master
i:
  309793: df6015c
  309791: 00960bc
v: v3
  • Loading branch information
Stanislav Kinsbursky authored and J. Bruce Fields committed Apr 11, 2012
1 parent 0a1fa1f commit 0afb8c8
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f890edbbeff6928b7db0c6179a9036cbd4f0efbf
refs/heads/master: e3f70eadb7dddfb5a2bb9afff7abfc6ee17a29d0
13 changes: 8 additions & 5 deletions trunk/fs/lockd/clntlock.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ struct nlm_host *nlmclnt_init(const struct nlmclnt_initdata *nlm_init)
u32 nlm_version = (nlm_init->nfs_version == 2) ? 1 : 4;
int status;

status = lockd_up();
status = lockd_up(nlm_init->net);
if (status < 0)
return ERR_PTR(status);

Expand All @@ -65,7 +65,7 @@ struct nlm_host *nlmclnt_init(const struct nlmclnt_initdata *nlm_init)
nlm_init->hostname, nlm_init->noresvport,
nlm_init->net);
if (host == NULL) {
lockd_down();
lockd_down(nlm_init->net);
return ERR_PTR(-ENOLCK);
}

Expand All @@ -80,8 +80,10 @@ EXPORT_SYMBOL_GPL(nlmclnt_init);
*/
void nlmclnt_done(struct nlm_host *host)
{
struct net *net = host->net;

nlmclnt_release_host(host);
lockd_down();
lockd_down(net);
}
EXPORT_SYMBOL_GPL(nlmclnt_done);

Expand Down Expand Up @@ -220,11 +222,12 @@ reclaimer(void *ptr)
struct nlm_wait *block;
struct file_lock *fl, *next;
u32 nsmstate;
struct net *net = host->net;

allow_signal(SIGKILL);

down_write(&host->h_rwsem);
lockd_up(); /* note: this cannot fail as lockd is already running */
lockd_up(net); /* note: this cannot fail as lockd is already running */

dprintk("lockd: reclaiming locks for host %s\n", host->h_name);

Expand Down Expand Up @@ -275,6 +278,6 @@ reclaimer(void *ptr)

/* Release host handle after use */
nlmclnt_release_host(host);
lockd_down();
lockd_down(net);
return 0;
}
7 changes: 3 additions & 4 deletions trunk/fs/lockd/svc.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,11 +295,10 @@ static void lockd_down_net(struct net *net)
/*
* Bring up the lockd process if it's not already up.
*/
int lockd_up(void)
int lockd_up(struct net *net)
{
struct svc_serv *serv;
int error = 0;
struct net *net = current->nsproxy->net_ns;

mutex_lock(&nlmsvc_mutex);
/*
Expand Down Expand Up @@ -378,12 +377,12 @@ EXPORT_SYMBOL_GPL(lockd_up);
* Decrement the user count and bring down lockd if we're the last.
*/
void
lockd_down(void)
lockd_down(struct net *net)
{
mutex_lock(&nlmsvc_mutex);
if (nlmsvc_users) {
if (--nlmsvc_users) {
lockd_down_net(current->nsproxy->net_ns);
lockd_down_net(net);
goto out;
}
} else {
Expand Down
6 changes: 3 additions & 3 deletions trunk/fs/nfsd/nfssvc.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ static int nfsd_startup(unsigned short port, int nrservs)
ret = nfsd_init_socks(port);
if (ret)
goto out_racache;
ret = lockd_up();
ret = lockd_up(&init_net);
if (ret)
goto out_racache;
ret = nfs4_state_start();
Expand All @@ -229,7 +229,7 @@ static int nfsd_startup(unsigned short port, int nrservs)
nfsd_up = true;
return 0;
out_lockd:
lockd_down();
lockd_down(&init_net);
out_racache:
nfsd_racache_shutdown();
return ret;
Expand All @@ -246,7 +246,7 @@ static void nfsd_shutdown(void)
if (!nfsd_up)
return;
nfs4_state_shutdown();
lockd_down();
lockd_down(&init_net);
nfsd_racache_shutdown();
nfsd_up = false;
}
Expand Down
4 changes: 2 additions & 2 deletions trunk/include/linux/lockd/bind.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ extern void nlmclnt_done(struct nlm_host *host);

extern int nlmclnt_proc(struct nlm_host *host, int cmd,
struct file_lock *fl);
extern int lockd_up(void);
extern void lockd_down(void);
extern int lockd_up(struct net *net);
extern void lockd_down(struct net *net);

#endif /* LINUX_LOCKD_BIND_H */

0 comments on commit 0afb8c8

Please sign in to comment.