Print out a warning and a backtrace if we try to unlock a lockmgr that

we do not hold.

Glanced at by:	phk
MFC after:	3 days
This commit is contained in:
Suleiman Souhlal 2005-09-02 15:56:01 +00:00
parent cdeb72045b
commit 1f71de49e1

View File

@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$");
#include <sys/stack.h>
#include <sys/sysctl.h>
#endif
#include <sys/kdb.h>
/*
* Locking primitives implementation.
@ -379,6 +380,12 @@ lockmgr(lkp, flags, interlkp, td)
}
} else if (lkp->lk_flags & LK_SHARE_NONZERO)
shareunlock(td, lkp, 1);
else {
printf("lockmgr: thread %p unlocking unheld lock\n",
thr);
kdb_backtrace();
}
if (lkp->lk_flags & LK_WAIT_NONZERO)
wakeup((void *)lkp);
break;