ocfs2/dlm: should put mle when goto kill in dlm_assert_master_handler
authoralex chen <alex.chen@huawei.com>
Thu, 2 Oct 2014 23:16:55 +0000 (16:16 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 2 Oct 2014 23:28:44 +0000 (16:28 -0700)
In dlm_assert_master_handler, the mle is get in dlm_find_mle, should be
put when goto kill, otherwise, this mle will never be released.

Signed-off-by: Alex Chen <alex.chen@huawei.com>
Reviewed-by: Joseph Qi <joseph.qi@huawei.com>
Reviewed-by: joyce.xue <xuejiufei@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>
fs/ocfs2/dlm/dlmmaster.c

index e3cfa0227026c64df16edc3705d9e607a16f6509..12ba682fc53c303964ee4eb2c0035c88765573d0 100644 (file)
@@ -2039,6 +2039,10 @@ kill:
             "and killing the other node now!  This node is OK and can continue.\n");
        __dlm_print_one_lock_resource(res);
        spin_unlock(&res->spinlock);
+       spin_lock(&dlm->master_lock);
+       if (mle)
+               __dlm_put_mle(mle);
+       spin_unlock(&dlm->master_lock);
        spin_unlock(&dlm->spinlock);
        *ret_data = (void *)res;
        dlm_put(dlm);