All of lore.kernel.org
 help / color / mirror / Atom feed
* [Cluster-devel] About dlm_unlock (kernel space)
@ 2016-06-13 11:15 Guoqing Jiang
  2016-06-13 14:56 ` David Teigland
  0 siblings, 1 reply; 3+ messages in thread
From: Guoqing Jiang @ 2016-06-13 11:15 UTC (permalink / raw)
  To: cluster-devel.redhat.com

Hi,

In case we have set DLM_LKF_CONVERT flag for dlm_lock, is it possible 
that the convert
queue could be NULL or not NULL while perform unlock? I think there are 
two different
cases would appear when call dlm_unlock:

1. the lock logic is in convert stage.
2. convert queue is null.

For 1, seems need to cancel the lock request first (dlm_unlock+CANCEL), 
then call
dlm_unlock. And just need to call dlm_unlock directly for case 2. Please 
correct me
if I am wrong.

And what could happen if cancel a lock which has a empty convert queue? 
Like call
dlm_unlock+CANCEL for case 2, is something wrong could happen?

The last question, is there a dlm_unlock_* variant which could do unlock 
finally for
both case1 and case2 (or does the variant make sense)?

Thanks & Regards,
Guoqing



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Cluster-devel] About dlm_unlock (kernel space)
  2016-06-13 11:15 [Cluster-devel] About dlm_unlock (kernel space) Guoqing Jiang
@ 2016-06-13 14:56 ` David Teigland
  2016-06-14  2:34   ` Guoqing Jiang
  0 siblings, 1 reply; 3+ messages in thread
From: David Teigland @ 2016-06-13 14:56 UTC (permalink / raw)
  To: cluster-devel.redhat.com

On Mon, Jun 13, 2016 at 07:15:09AM -0400, Guoqing Jiang wrote:
> Hi,
> 
> In case we have set DLM_LKF_CONVERT flag for dlm_lock, is it
> possible that the convert
> queue could be NULL or not NULL while perform unlock? I think there
> are two different
> cases would appear when call dlm_unlock:
> 
> 1. the lock logic is in convert stage.
> 2. convert queue is null.
> 
> For 1, seems need to cancel the lock request first
> (dlm_unlock+CANCEL), then call
> dlm_unlock. And just need to call dlm_unlock directly for case 2.
> Please correct me
> if I am wrong.
> 
> And what could happen if cancel a lock which has a empty convert
> queue? Like call
> dlm_unlock+CANCEL for case 2, is something wrong could happen?
> 
> The last question, is there a dlm_unlock_* variant which could do
> unlock finally for
> both case1 and case2 (or does the variant make sense)?

Convert is not a stable state, which means that cancel always involves a
race:  the convert could complete before the cancel is processed.  After
convert has finished, or after cancel has finished, then you know that the
lock is not converting and a simple unlock will work.  I suggest you test
these combinations to see how they behave in practice.  Doing unlock with
FORCEUNLOCK is also an option (that works even if the lock is on the
waiting or convert queue.)  I'd be judicious about using either CANCEL or
FORCEUNLOCK.



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Cluster-devel] About dlm_unlock (kernel space)
  2016-06-13 14:56 ` David Teigland
@ 2016-06-14  2:34   ` Guoqing Jiang
  0 siblings, 0 replies; 3+ messages in thread
From: Guoqing Jiang @ 2016-06-14  2:34 UTC (permalink / raw)
  To: cluster-devel.redhat.com



On 06/13/2016 10:56 PM, David Teigland wrote:
> On Mon, Jun 13, 2016 at 07:15:09AM -0400, Guoqing Jiang wrote:
>> Hi,
>>
>> In case we have set DLM_LKF_CONVERT flag for dlm_lock, is it
>> possible that the convert
>> queue could be NULL or not NULL while perform unlock? I think there
>> are two different
>> cases would appear when call dlm_unlock:
>>
>> 1. the lock logic is in convert stage.
>> 2. convert queue is null.
>>
>> For 1, seems need to cancel the lock request first
>> (dlm_unlock+CANCEL), then call
>> dlm_unlock. And just need to call dlm_unlock directly for case 2.
>> Please correct me
>> if I am wrong.
>>
>> And what could happen if cancel a lock which has a empty convert
>> queue? Like call
>> dlm_unlock+CANCEL for case 2, is something wrong could happen?
>>
>> The last question, is there a dlm_unlock_* variant which could do
>> unlock finally for
>> both case1 and case2 (or does the variant make sense)?
> Convert is not a stable state, which means that cancel always involves a
> race:  the convert could complete before the cancel is processed.  After
> convert has finished, or after cancel has finished, then you know that the
> lock is not converting and a simple unlock will work.  I suggest you test
> these combinations to see how they behave in practice.  Doing unlock with
> FORCEUNLOCK is also an option (that works even if the lock is on the
> waiting or convert queue.)  I'd be judicious about using either CANCEL or
> FORCEUNLOCK.
>
>

Thanks a lot for detailed infos and suggestions! Looks FORCEUNLOCK
flag is perfect since it is suitable for both 1 and 2, I will use it and see
what will happen in practice.

Cheers,
Guoqing



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-06-14  2:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-13 11:15 [Cluster-devel] About dlm_unlock (kernel space) Guoqing Jiang
2016-06-13 14:56 ` David Teigland
2016-06-14  2:34   ` Guoqing Jiang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.