[Ocfs2-devel] [PATCH 1/1] dlm: fix a race in lockres mastery

Sunil Mushran sunil.mushran at oracle.com
Mon Mar 22 18:20:32 PDT 2010


yes, your wording is better. and yes, dlm->spinlock is the
top level lock.

Joel Becker wrote:
> On Mon, Mar 22, 2010 at 05:41:43PM -0700, Sunil Mushran wrote:
>   
>> =================================================================
>> In o2dlm, the resource master maintains a (ref)map of all nodes that
>> are informed of the fact that that node masters that resource. This is
>> done to prevent the master from purging the resource before the other
>> node can create a lock.
>>
>> This patch plugs a race between the mastery handler thread and the
>> mastery thread that allows the node to discover the master of the
>> resource without informing the master node.
>>
>> Fixes ossbz#1012
>> http://oss.oracle.com/bugzilla/show_bug.cgi?id=1012
>> =================================================================
>>
>> Add my sob and change the comment to the above.
>> Signed-off-by: Sunil Mushran <sunil.mushran at oracle.com>
>>     
>
> 	The comment above makes even less sense to me than Srini's.
> Hiss, while a little confusing to read, made me feel like I would get it
> if I just looked at the code.  This text is...mumbo-jumbo.  "the
> resource master maintains a map of all nodes that are informed of the
> fact that that node masters that resource" indeed.
> 	Let me see if I can parse it:
>
> ------------------------------------------
> In o2dlm, the master of a lock resource keeps a map of all interested
> nodes.  This prevents the master from purging the resource before an
> interested node can create a lock.
>
> A race between the mastery thread and the mastery handler allowed an
> interested node to discover the who the master is without informing the
> master directly.  This is easily fixed by holding the dlm spinlock a
> little longer in the mastery handler.
> ------------------------------------------
>
> How's that?
> 	I also had a question about the patch.  It is safe to hold the
> dlm spinlock across all the other spinlocks, right?  I believe that the
> dlm spinlock is toplevel, so I'm pretty sure it is, but I wanted to
> verify.
>
> Joel
>
>   




More information about the Ocfs2-devel mailing list