Linux ocfs2 filesystem development
 help / color / mirror / Atom feed
* [Ocfs2-devel] [PATCH] ocfs2/dlm: add missing dlm_lock_put() when recovery master down
@ 2014-12-24  9:14 Xue jiufei
  0 siblings, 0 replies; only message in thread
From: Xue jiufei @ 2014-12-24  9:14 UTC (permalink / raw)
  To: ocfs2-devel

When recovery master down, the owner of $RECOVERY calls
dlm_do_local_recovery_cleanup() to prune any $RECOVERY entries for dead
nodes. The lock is in granted list and refcount must be 2.
We should put twice to remove this lock. Otherwise, it will lead to
memory leak.

Reported-by: yangwenfang <vicky.yangwenfang@huawei.com>
Signed-off-by: joyce.xue <xuejiufei@huawei.com>
---
 fs/ocfs2/dlm/dlmrecovery.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/fs/ocfs2/dlm/dlmrecovery.c b/fs/ocfs2/dlm/dlmrecovery.c
index 3365839..8576c1f 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,
 					     dead_node, dlm->name);
 					list_del_init(&lock->list);
 					dlm_lock_put(lock);
+					/* Can't schedule DLM_UNLOCK_FREE_LOCK
+					 * - do manually */
+					dlm_lock_put(lock);
 					break;
 				}
 			}
@@ -2341,6 +2344,10 @@ static void dlm_do_local_recovery_cleanup(struct dlm_ctxt *dlm, u8 dead_node)
 						     dead_node, dlm->name);
 						list_del_init(&lock->list);
 						dlm_lock_put(lock);
+						/* Can't schedule
+						 * DLM_UNLOCK_FREE_LOCK
+						 * - do manually */
+						dlm_lock_put(lock);
 						break;
 					}
 				}
-- 
1.8.4.3

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2014-12-24  9:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-24  9:14 [Ocfs2-devel] [PATCH] ocfs2/dlm: add missing dlm_lock_put() when recovery master down Xue jiufei

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox