From a507c037d1b2afa21a8c9ee16158940e8875a505 Mon Sep 17 00:00:00 2001 From: Trond Myklebust Date: Tue, 1 Apr 2008 18:58:49 -0400 Subject: [PATCH] --- yaml --- r: 92917 b: refs/heads/master c: 5e7f37a76fa5b604949020b7317962262812b2dd h: refs/heads/master i: 92915: 594251204f05a6d1fdabe794b2128b4ba74074fd v: v3 --- [refs] | 2 +- trunk/fs/lockd/clntproc.c | 3 +++ trunk/include/linux/lockd/lockd.h | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 649672aad1e3..3413b9d7d59a 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 536ff0f809b0f4d56e1c41e66768d330668e0a55 +refs/heads/master: 5e7f37a76fa5b604949020b7317962262812b2dd diff --git a/trunk/fs/lockd/clntproc.c b/trunk/fs/lockd/clntproc.c index 4e1c0123b45d..749eb5328cb0 100644 --- a/trunk/fs/lockd/clntproc.c +++ b/trunk/fs/lockd/clntproc.c @@ -221,6 +221,7 @@ struct nlm_rqst *nlm_alloc_call(struct nlm_host *host) for(;;) { call = kzalloc(sizeof(*call), GFP_KERNEL); if (call != NULL) { + atomic_set(&call->a_count, 1); locks_init_lock(&call->a_args.lock.fl); locks_init_lock(&call->a_res.lock.fl); call->a_host = host; @@ -237,6 +238,8 @@ struct nlm_rqst *nlm_alloc_call(struct nlm_host *host) void nlm_release_call(struct nlm_rqst *call) { + if (!atomic_dec_and_test(&call->a_count)) + return; nlm_release_host(call->a_host); nlmclnt_release_lockargs(call); kfree(call); diff --git a/trunk/include/linux/lockd/lockd.h b/trunk/include/linux/lockd/lockd.h index acf39e1e3a3d..94649a8da014 100644 --- a/trunk/include/linux/lockd/lockd.h +++ b/trunk/include/linux/lockd/lockd.h @@ -91,6 +91,7 @@ struct nlm_wait; */ #define NLMCLNT_OHSIZE ((__NEW_UTS_LEN) + 10u) struct nlm_rqst { + atomic_t a_count; unsigned int a_flags; /* initial RPC task flags */ struct nlm_host * a_host; /* host handle */ struct nlm_args a_args; /* arguments */