1471e24 sanlock: fix missing dblock return from paxos_lease_acquire

Authored and Committed by teigland 5 years ago
    sanlock: fix missing dblock return from paxos_lease_acquire
    
    In commit 933a474339ded8d025c99356f583d228b6a2b9ba
      sanlock: fix release interference with paxos
    
    The function write_mblock_shared_dblock_release()
    was added to preserve the current dblock values
    when setting the mode block in the same sector.
    The latest copy of the dblock that was returned
    from paxos_lease_acquire was saved and copied into
    the buffer used to write the mode block.
    
    The problem is that the latest copy of the dblock was
    not always being returned from paxos_lease_acquire [1].
    The result is that a host was sometimes copying garbage
    dblock values back into its dblock.  If other hosts then
    tried to acquire this same lock, they could get confused
    by the invalid dblock values.
    
    The specific problem that was seen is where the bad
    dblock lver value was larger than the lver value in the
    leader record.  This would cause paxos_lease_acquire on
    the other host to repeatedly abort paxos_lease_acquire
    because of the "larger lver in bk" (believing another
    host was competing for a newer version of the lease.)
    
    [1] The failure to return the latest dblock copy was
    introduced in commit 6501351b742:
      sanlock: preserve dblock values when setting shared flag
    
    The specific problem in that commit is when another host
    commits us as the lease owner, in which case
    paxos_lease_acquire missed returning its latest dblock.
    
        
file modified
+1 -0
file modified
+2 -0