aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/ops_fstype.c
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2011-03-09 10:58:04 +0000
committerSteven Whitehouse <swhiteho@redhat.com>2011-03-09 10:58:04 +0000
commitfc0e38dae645f65424d1fb5d2a938aab8ce48a58 (patch)
tree8b0a89a0de01a0504a002a184a290a53545fce82 /fs/gfs2/ops_fstype.c
parent662e3a551b468c7338f5291d7a00389fe85885e2 (diff)
downloadkernel_samsung_smdk4412-fc0e38dae645f65424d1fb5d2a938aab8ce48a58.zip
kernel_samsung_smdk4412-fc0e38dae645f65424d1fb5d2a938aab8ce48a58.tar.gz
kernel_samsung_smdk4412-fc0e38dae645f65424d1fb5d2a938aab8ce48a58.tar.bz2
GFS2: Fix glock deallocation race
This patch fixes a race in deallocating glocks which was introduced in the RCU glock patch. We need to ensure that the glock count is kept correct even in the case that there is a race to add a new glock into the hash table. Also, to avoid having to wait for an RCU grace period, the glock counter can be decremented before call_rcu() is called. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/ops_fstype.c')
-rw-r--r--fs/gfs2/ops_fstype.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c
index a39c103..67654d0 100644
--- a/fs/gfs2/ops_fstype.c
+++ b/fs/gfs2/ops_fstype.c
@@ -928,14 +928,9 @@ static const match_table_t nolock_tokens = {
{ Opt_err, NULL },
};
-static void nolock_put_lock(struct gfs2_glock *gl)
-{
- call_rcu(&gl->gl_rcu, gfs2_glock_free);
-}
-
static const struct lm_lockops nolock_ops = {
.lm_proto_name = "lock_nolock",
- .lm_put_lock = nolock_put_lock,
+ .lm_put_lock = gfs2_glock_free,
.lm_tokens = &nolock_tokens,
};