Showing error 1046

User: Jiri Slaby
Error type: Leaving function in locked state
Error type description: Some lock is not unlocked on all paths of a function, so it is leaked
File location: fs/ocfs2/dlm/dlmthread.c
Line in file: 80
Project: Linux Kernel
Project version: 2.6.28
Tools: Undetermined 1
Entered: 2012-03-04 17:07:06 UTC


Source:

 50#include "dlmcommon.h"
 51#include "dlmdomain.h"
 52
 53#define MLOG_MASK_PREFIX (ML_DLM|ML_DLM_THREAD)
 54#include "cluster/masklog.h"
 55
 56static int dlm_thread(void *data);
 57static void dlm_flush_asts(struct dlm_ctxt *dlm);
 58
 59#define dlm_lock_is_remote(dlm, lock)     ((lock)->ml.node != (dlm)->node_num)
 60
 61/* will exit holding res->spinlock, but may drop in function */
 62/* waits until flags are cleared on res->state */
 63void __dlm_wait_on_lockres_flags(struct dlm_lock_resource *res, int flags)
 64{
 65        DECLARE_WAITQUEUE(wait, current);
 66
 67        assert_spin_locked(&res->spinlock);
 68
 69        add_wait_queue(&res->wq, &wait);
 70repeat:
 71        set_current_state(TASK_UNINTERRUPTIBLE);
 72        if (res->state & flags) {
 73                spin_unlock(&res->spinlock);
 74                schedule();
 75                spin_lock(&res->spinlock);
 76                goto repeat;
 77        }
 78        remove_wait_queue(&res->wq, &wait);
 79        __set_current_state(TASK_RUNNING);
 80}
 81
 82int __dlm_lockres_has_locks(struct dlm_lock_resource *res)
 83{
 84        if (list_empty(&res->granted) &&
 85            list_empty(&res->converting) &&
 86            list_empty(&res->blocked))
 87                return 0;
 88        return 1;
 89}
 90
Show full sources