convert if/panic -> KASSERT, explain what triggered the assertion
This commit is contained in:
parent
c13d191de3
commit
1375ed7eb7
@ -278,8 +278,10 @@ debuglockmgr(lkp, flags, interlkp, p, name, file, line)
|
||||
/* fall into downgrade */
|
||||
|
||||
case LK_DOWNGRADE:
|
||||
if (lkp->lk_lockholder != pid || lkp->lk_exclusivecount == 0)
|
||||
panic("lockmgr: not holding exclusive lock");
|
||||
KASSERT(lkp->lk_lockholder == pid && lkp->lk_exclusivecount != 0,
|
||||
("lockmgr: not holding exclusive lock "
|
||||
"(owner pid (%d) != pid (%d), exlcnt (%d) != 0",
|
||||
lkp->lk_lockholder, pid, lkp->lk_exclusivecount));
|
||||
sharelock(lkp, lkp->lk_exclusivecount);
|
||||
lkp->lk_exclusivecount = 0;
|
||||
lkp->lk_flags &= ~LK_HAVE_EXCL;
|
||||
|
Loading…
Reference in New Issue
Block a user