e66d5d1 sanlock: persistent and orphan resource leases

Authored and Committed by teigland 9 years ago
    sanlock: persistent and orphan resource leases
    
    If a resource lease has the PERSISTENT flag set when it is
    acquired, then sanlock will not release the lease if the
    process holding the lease exits.  Instead, the lease is
    moved to the orphans list.  From the perspective of other
    hosts, and on disk, there is no difference between a held
    lease and an orphan lease.  On the origin host, another
    process can acquire an orphan lease by using the
    ACQUIRE_ORPHAN flag, or release an orphan lease using
    the REL_ORPHAN flag.  All orphan leases in a lockspace can
    be released using REL_ORPHAN and setting the lockspace name
    and an empty resource name.
    
    If the lockspace config flag SANLK_CONFIG_USED_BY_ORPHANS
    is set, then an orphan resource in a lockspace will have
    the same effect on the lockspace as the USED flag or clients
    holding resources that have not exited.  Other things on the
    host may still be using resources that are protected by the
    orphaned resource lease, so it is not safe to release the
    lockspace, which would allow another host to acquire the
    orphan lease.
    
    If SANLK_CONFIG_USED_BY_ORPHANS is not set, then orphans
    will have no effect on the removal of a lockspace.  When
    the lockspace is removed, the orphans will just be left.
    
    Signed-off-by: David Teigland <teigland@redhat.com>
    
        
file modified
+2 -0
file modified
+20 -1
file modified
+49 -5
file modified
+47 -0
file modified
+84 -10
file modified
+145 -0
file modified
+33 -0
file modified
+30 -2
file modified
+27 -0
file modified
+9 -2
file modified
+12 -1
file modified
+11 -0