git: kernel - Fix rare lockmgr() state transition

Matthew Dillon dillon at crater.dragonflybsd.org
Sat Sep 30 18:12:36 PDT 2017


commit 616bc26b4964cc05c0649e6fa65cc5eb2f5b50f4
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(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/616bc26b4964cc05c0649e6fa65cc5eb2f5b50f4


-- 
DragonFly BSD source repository



More information about the Commits mailing list