ocfs2_dlm: Missing get/put lockres in dlm_run_purge_lockres
authorSunil Mushran <sunil.mushran@oracle.com>
Mon, 12 Mar 2007 20:24:34 +0000 (13:24 -0700)
committerMark Fasheh <mark.fasheh@oracle.com>
Wed, 14 Mar 2007 21:37:33 +0000 (14:37 -0700)
In some circumstances, this was causing us to reference freed memory.

Signed-off-by: Sunil Mushran <sunil.mushran@oracle.com>
Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
fs/ocfs2/dlm/dlmthread.c

index 8ffa0916eb86fc1c111ae3964b156505f714c6e6..6421a8fae1de50ce0f6ea4283e7f7013ec79e977 100644 (file)
@@ -265,8 +265,10 @@ static void dlm_run_purge_list(struct dlm_ctxt *dlm,
                /* This may drop and reacquire the dlm spinlock if it
                 * has to do migration. */
                mlog(0, "calling dlm_purge_lockres!\n");
+               dlm_lockres_get(lockres);
                if (dlm_purge_lockres(dlm, lockres))
                        BUG();
+               dlm_lockres_put(lockres);
                mlog(0, "DONE calling dlm_purge_lockres!\n");
 
                /* Avoid adding any scheduling latencies */