mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-30 16:51:41 +00:00
- transferlockers() requires the interlock to be SMP safe.
Sponsored by: Isilon Systems, Inc.
This commit is contained in:
parent
e9f2afc1b8
commit
f5f0da0a0e
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=143621
@ -517,14 +517,20 @@ transferlockers(from, to)
|
||||
|
||||
KASSERT(from != to, ("lock transfer to self"));
|
||||
KASSERT((from->lk_flags&LK_WAITDRAIN) == 0, ("transfer draining lock"));
|
||||
if (from->lk_waitcount == 0)
|
||||
|
||||
mtx_lock(from->lk_interlock);
|
||||
if (from->lk_waitcount == 0) {
|
||||
mtx_unlock(from->lk_interlock);
|
||||
return;
|
||||
}
|
||||
from->lk_newlock = to;
|
||||
wakeup((void *)from);
|
||||
msleep(&from->lk_newlock, NULL, from->lk_prio, "lkxfer", 0);
|
||||
msleep(&from->lk_newlock, from->lk_interlock, from->lk_prio,
|
||||
"lkxfer", 0);
|
||||
from->lk_newlock = NULL;
|
||||
from->lk_flags &= ~(LK_WANT_EXCL | LK_WANT_UPGRADE);
|
||||
KASSERT(from->lk_waitcount == 0, ("active lock"));
|
||||
mtx_unlock(from->lk_interlock);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user