diff options
-rw-r--r-- | fs/lockd/clntproc.c | 3 | ||||
-rw-r--r-- | include/linux/lockd/lockd.h | 1 |
2 files changed, 4 insertions, 0 deletions
diff --git a/fs/lockd/clntproc.c b/fs/lockd/clntproc.c index 4e1c0123b45d..749eb5328cb0 100644 --- a/fs/lockd/clntproc.c +++ b/fs/lockd/clntproc.c | |||
@@ -221,6 +221,7 @@ struct nlm_rqst *nlm_alloc_call(struct nlm_host *host) | |||
221 | for(;;) { | 221 | for(;;) { |
222 | call = kzalloc(sizeof(*call), GFP_KERNEL); | 222 | call = kzalloc(sizeof(*call), GFP_KERNEL); |
223 | if (call != NULL) { | 223 | if (call != NULL) { |
224 | atomic_set(&call->a_count, 1); | ||
224 | locks_init_lock(&call->a_args.lock.fl); | 225 | locks_init_lock(&call->a_args.lock.fl); |
225 | locks_init_lock(&call->a_res.lock.fl); | 226 | locks_init_lock(&call->a_res.lock.fl); |
226 | call->a_host = host; | 227 | call->a_host = host; |
@@ -237,6 +238,8 @@ struct nlm_rqst *nlm_alloc_call(struct nlm_host *host) | |||
237 | 238 | ||
238 | void nlm_release_call(struct nlm_rqst *call) | 239 | void nlm_release_call(struct nlm_rqst *call) |
239 | { | 240 | { |
241 | if (!atomic_dec_and_test(&call->a_count)) | ||
242 | return; | ||
240 | nlm_release_host(call->a_host); | 243 | nlm_release_host(call->a_host); |
241 | nlmclnt_release_lockargs(call); | 244 | nlmclnt_release_lockargs(call); |
242 | kfree(call); | 245 | kfree(call); |
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h index acf39e1e3a3d..94649a8da014 100644 --- a/include/linux/lockd/lockd.h +++ b/include/linux/lockd/lockd.h | |||
@@ -91,6 +91,7 @@ struct nlm_wait; | |||
91 | */ | 91 | */ |
92 | #define NLMCLNT_OHSIZE ((__NEW_UTS_LEN) + 10u) | 92 | #define NLMCLNT_OHSIZE ((__NEW_UTS_LEN) + 10u) |
93 | struct nlm_rqst { | 93 | struct nlm_rqst { |
94 | atomic_t a_count; | ||
94 | unsigned int a_flags; /* initial RPC task flags */ | 95 | unsigned int a_flags; /* initial RPC task flags */ |
95 | struct nlm_host * a_host; /* host handle */ | 96 | struct nlm_host * a_host; /* host handle */ |
96 | struct nlm_args a_args; /* arguments */ | 97 | struct nlm_args a_args; /* arguments */ |