mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2025-01-11 17:04:19 +01:00
Reintroduce slightly modified patch from kern/69964. Check for
LK_HAVE_EXL in both acquire invocations. MFC after: 5 days
This commit is contained in:
parent
0ca311f6a1
commit
4cef6d5a53
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=134365
@ -335,8 +335,12 @@ debuglockmgr(lkp, flags, interlkp, td, name, file, line)
|
||||
error = acquire(&lkp, extflags, LK_SHARE_NONZERO);
|
||||
lkp->lk_flags &= ~LK_WANT_UPGRADE;
|
||||
|
||||
if (error)
|
||||
break;
|
||||
if (error) {
|
||||
if ((lkp->lk_flags & ( LK_WANT_EXCL | LK_WAIT_NONZERO)) == (LK_WANT_EXCL | LK_WAIT_NONZERO))
|
||||
wakeup((void *)lkp);
|
||||
break;
|
||||
}
|
||||
|
||||
lkp->lk_flags |= LK_HAVE_EXCL;
|
||||
lkp->lk_lockholder = thr;
|
||||
if (lkp->lk_exclusivecount != 0)
|
||||
@ -389,10 +393,13 @@ debuglockmgr(lkp, flags, interlkp, td, name, file, line)
|
||||
/*
|
||||
* Wait for shared locks and upgrades to finish.
|
||||
*/
|
||||
error = acquire(&lkp, extflags, LK_WANT_UPGRADE | LK_SHARE_NONZERO);
|
||||
error = acquire(&lkp, extflags, LK_HAVE_EXCL | LK_WANT_UPGRADE | LK_SHARE_NONZERO);
|
||||
lkp->lk_flags &= ~LK_WANT_EXCL;
|
||||
if (error)
|
||||
if (error) {
|
||||
if (lkp->lk_flags & LK_WAIT_NONZERO)
|
||||
wakeup((void *)lkp);
|
||||
break;
|
||||
}
|
||||
lkp->lk_flags |= LK_HAVE_EXCL;
|
||||
lkp->lk_lockholder = thr;
|
||||
if (lkp->lk_exclusivecount != 0)
|
||||
|
Loading…
Reference in New Issue
Block a user