diff options
author | Xue jiufei <xuejiufei@huawei.com> | 2015-02-10 17:08:40 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-02-10 17:30:28 -0500 |
commit | b934beaf4b920a95db012b3d4476e8375dd4415b (patch) | |
tree | d1b96305b5ff4dae090ff6a323e1c5167ff4d473 /fs/ocfs2 | |
parent | 102ca6606c96979cbef53dff30deac5e909a1914 (diff) |
ocfs2/dlm: add missing dlm_lock_put() when recovery master down
When the recovery master is down, the owner of $RECOVERY calls
dlm_do_local_recovery_cleanup() to prune any $RECOVERY entries for dead
nodes. The lock is in the granted list and the refcount must be 2. We
should put twice to remove this lock. Otherwise, it will lead to a memory
leak.
Signed-off-by: joyce.xue <xuejiufei@huawei.com>
Reported-by: yangwenfang <vicky.yangwenfang@huawei.com>
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Joel Becker <jlbec@evilplan.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/ocfs2')
-rw-r--r-- | fs/ocfs2/dlm/dlmrecovery.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/ocfs2/dlm/dlmrecovery.c b/fs/ocfs2/dlm/dlmrecovery.c index cecd875653e4..ce12e0b1a31f 100644 --- a/fs/ocfs2/dlm/dlmrecovery.c +++ b/fs/ocfs2/dlm/dlmrecovery.c | |||
@@ -1070,6 +1070,9 @@ static void dlm_move_reco_locks_to_list(struct dlm_ctxt *dlm, | |||
1070 | dead_node, dlm->name); | 1070 | dead_node, dlm->name); |
1071 | list_del_init(&lock->list); | 1071 | list_del_init(&lock->list); |
1072 | dlm_lock_put(lock); | 1072 | dlm_lock_put(lock); |
1073 | /* Can't schedule DLM_UNLOCK_FREE_LOCK | ||
1074 | * - do manually */ | ||
1075 | dlm_lock_put(lock); | ||
1073 | break; | 1076 | break; |
1074 | } | 1077 | } |
1075 | } | 1078 | } |
@@ -2346,6 +2349,10 @@ static void dlm_do_local_recovery_cleanup(struct dlm_ctxt *dlm, u8 dead_node) | |||
2346 | dead_node, dlm->name); | 2349 | dead_node, dlm->name); |
2347 | list_del_init(&lock->list); | 2350 | list_del_init(&lock->list); |
2348 | dlm_lock_put(lock); | 2351 | dlm_lock_put(lock); |
2352 | /* Can't schedule | ||
2353 | * DLM_UNLOCK_FREE_LOCK | ||
2354 | * - do manually */ | ||
2355 | dlm_lock_put(lock); | ||
2349 | break; | 2356 | break; |
2350 | } | 2357 | } |
2351 | } | 2358 | } |