Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 320409
b: refs/heads/master
c: caa4e76
h: refs/heads/master
i:
  320407: 09e455c
v: v3
  • Loading branch information
Stanislav Kinsbursky authored and J. Bruce Fields committed Jul 27, 2012
1 parent 958d7a0 commit 021d1ee
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3cf7fb07e077e599d8343113cf4ef81adb2ca627
refs/heads/master: caa4e76b6f284bab535a98fd37b9c46856158bcb
18 changes: 18 additions & 0 deletions trunk/fs/lockd/host.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ static struct nlm_host *nlm_alloc_host(struct nlm_lookup_host_info *ni,
static void nlm_destroy_host_locked(struct nlm_host *host)
{
struct rpc_clnt *clnt;
struct lockd_net *ln = net_generic(host->net, lockd_net_id);

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

Expand All @@ -189,6 +190,7 @@ static void nlm_destroy_host_locked(struct nlm_host *host)
rpc_shutdown_client(clnt);
kfree(host);

ln->nrhosts--;
nrhosts--;
}

Expand Down Expand Up @@ -229,6 +231,7 @@ struct nlm_host *nlmclnt_lookup_host(const struct sockaddr *sap,
struct hlist_node *pos;
struct nlm_host *host;
struct nsm_handle *nsm = NULL;
struct lockd_net *ln = net_generic(net, lockd_net_id);

dprintk("lockd: %s(host='%s', vers=%u, proto=%s)\n", __func__,
(hostname ? hostname : "<none>"), version,
Expand Down Expand Up @@ -263,6 +266,7 @@ struct nlm_host *nlmclnt_lookup_host(const struct sockaddr *sap,
goto out;

hlist_add_head(&host->h_hash, chain);
ln->nrhosts++;
nrhosts++;

dprintk("lockd: %s created host %s (%s)\n", __func__,
Expand Down Expand Up @@ -384,6 +388,7 @@ struct nlm_host *nlmsvc_lookup_host(const struct svc_rqst *rqstp,
memcpy(nlm_srcaddr(host), src_sap, src_len);
host->h_srcaddrlen = src_len;
hlist_add_head(&host->h_hash, chain);
ln->nrhosts++;
nrhosts++;

dprintk("lockd: %s created host %s (%s)\n",
Expand Down Expand Up @@ -592,6 +597,19 @@ nlm_shutdown_hosts_net(struct net *net)
/* Then, perform a garbage collection pass */
nlm_gc_hosts(net);
mutex_unlock(&nlm_host_mutex);

/* complain if any hosts are left */
if (net) {
struct lockd_net *ln = net_generic(net, lockd_net_id);

printk(KERN_WARNING "lockd: couldn't shutdown host module for net %p!\n", net);
dprintk("lockd: %lu hosts left in net %p:\n", ln->nrhosts, net);
for_each_host(host, pos, chain, nlm_server_hosts) {
dprintk(" %s (cnt %d use %d exp %ld net %p)\n",
host->h_name, atomic_read(&host->h_count),
host->h_inuse, host->h_expires, host->net);
}
}
}

/*
Expand Down
1 change: 1 addition & 0 deletions trunk/fs/lockd/netns.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
struct lockd_net {
unsigned int nlmsvc_users;
unsigned long next_gc;
unsigned long nrhosts;
};

extern int lockd_net_id;
Expand Down

0 comments on commit 021d1ee

Please sign in to comment.