git: kernel - Fix rare lockmgr() state transition
dillon at crater.dragonflybsd.org
Sat Sep 30 18:12:36 PDT 2017
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date: Sat Sep 30 15:12:30 2017 -0700
kernel - Fix rare lockmgr() state transition
* When lockmgr() is releasing the last count on an exclusive lock
with an upgrade request pending, and the atomic op fails, the
code fails to properly retry. Fixed by properly retrying.
* This situation should not be possible to even get into, hence 'rare'.
It requires UPREQ to be set while the lock is being held exclusively,
which should never be possible because there is no shared lock holder
in that case who might attempt to upgrade.
I checked race conditions when multiple shared holders attempt
to upgrade but all that happens is that one will release and
acquire a normal exclusive lock instead.
Summary of changes:
sys/kern/kern_lock.c | 29 +++++++++++++++++++++++++----
1 file changed, 25 insertions(+), 4 deletions(-)
DragonFly BSD source repository
More information about the Commits