diff options
| -rw-r--r-- | fs/lockd/mon.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/fs/lockd/mon.c b/fs/lockd/mon.c index fe695603e395..3d7e09bcc0e9 100644 --- a/fs/lockd/mon.c +++ b/fs/lockd/mon.c | |||
| @@ -124,18 +124,16 @@ out: | |||
| 124 | static void nsm_client_put(struct net *net) | 124 | static void nsm_client_put(struct net *net) |
| 125 | { | 125 | { |
| 126 | struct lockd_net *ln = net_generic(net, lockd_net_id); | 126 | struct lockd_net *ln = net_generic(net, lockd_net_id); |
| 127 | struct rpc_clnt *clnt = ln->nsm_clnt; | 127 | struct rpc_clnt *clnt = NULL; |
| 128 | int shutdown = 0; | ||
| 129 | 128 | ||
| 130 | spin_lock(&ln->nsm_clnt_lock); | 129 | spin_lock(&ln->nsm_clnt_lock); |
| 131 | if (ln->nsm_users) { | 130 | ln->nsm_users--; |
| 132 | if (--ln->nsm_users) | 131 | if (ln->nsm_users == 0) { |
| 133 | ln->nsm_clnt = NULL; | 132 | clnt = ln->nsm_clnt; |
| 134 | shutdown = !ln->nsm_users; | 133 | ln->nsm_clnt = NULL; |
| 135 | } | 134 | } |
| 136 | spin_unlock(&ln->nsm_clnt_lock); | 135 | spin_unlock(&ln->nsm_clnt_lock); |
| 137 | 136 | if (clnt != NULL) | |
| 138 | if (shutdown) | ||
| 139 | rpc_shutdown_client(clnt); | 137 | rpc_shutdown_client(clnt); |
| 140 | } | 138 | } |
| 141 | 139 | ||
