[Ocfs2-devel] [PATCH] o2dlm: check lockres validity in createlock
Sunil Mushran
sunil.mushran at oracle.com
Thu May 12 19:35:38 PDT 2011
On 05/12/2011 01:57 AM, Wengang Wang wrote:
> On 11-05-11 12:06, Sunil Mushran wrote:
>> Oh a remote master. So ignore my previous reply.
>>
>> Yes, I can see the race. But the fix below lets the purge to continue
>> and handles it afterwards. A better approach (and more efficient)
>> would be to remove the lockres from the purge list itself.
>>
>> So the race window is between the first block in dlm_get_lock_resource()
>> and dlm_lock_remote().
>>
>> See dlm->inflight_locks. Currently we use this when lockres is locally
>> mastered. Maybe we could use the same for locally mastered too.
> Sunil,
>
> So the only purpose of inflight_locks is to prevent the lockres from
> being purged, right?
>
> I think only removing the lockres from the purge list is enough.
>
> If we hack on inflight_locks, we don't need to remove the lockres from purge list,
> right?
Yes. But you have to be careful. inflight_locks currently is used
to prevent a race in locally mastered resources. I think we can
use it for remotely mastered too.
More information about the Ocfs2-devel
mailing list