Skip to contentSkip to conversation

Deadlock in dlmmaster.c

DISCUSSION Jan Kucera 2 participants 2 messages May 3, 2009 – May 4, 2009

Subsystems (2)
lore
Share & tools
lore

Jan Kucera

author
#0 lore raw

Hi,

I've found some possible deadlock in fs/ocfs2/dlm/dlmmaster.c - version 2.6.28 (probably this code is in newer versions too).
Could someone confirm this? Thank you.

fs/ocfs2/dlm/dlmmaster.c
==================

function dlm_master_request_handler: (res->spinlock <- dlm->master_lock)
-----------------------------------
spin_lock(&res->spinlock); at line 1427 spin_lock(&dlm->master_lock); at line 1475

function dlm_migrate_request_handler: (dlm->master_lock <- res->spinlock)
-------------------------------------------------------
spin_lock(&dlm->master_lock) at line 3036 spin_lock(&res->spinlock); at line 3039

caught by Stanse
(http://iti.fi.muni.cz/stanse/)

_______________________________________________
Ocfs2-devel mailing list
[email protected]
http://oss.oracle.com/mailman/listinfo/ocfs2-devel

#1 lore raw
Quoted 13 lines · Jan Kucera

I've found some possible deadlock in fs/ocfs2/dlm/dlmmaster.c - version 2.6.28 (probably this code is in newer versions too). Could someone confirm this? Thank you.

fs/ocfs2/dlm/dlmmaster.c
==================

function dlm_master_request_handler: (res->spinlock <- dlm->master_lock)
-----------------------------------
spin_lock(&res->spinlock); at line 1427 spin_lock(&dlm->master_lock); at line 1475

Quoted 4 lines

function dlm_migrate_request_handler: (dlm->master_lock <- res->spinlock)
-------------------------------------------------------
spin_lock(&dlm->master_lock) at line 3036 spin_lock(&res->spinlock); at line 3039

So this should not happen.

The first condition can only be hit if the resource has no master and is in the process of being mastered.

The second condition will only be hit if the resource has a master and is currently being migrated (remastered) from one node to another.

The two appear to be mutually exclusive. But feel free to file a bugzilla so that I remember to look into it more carefully when I have more time.
http://oss.oracle.com/bugzilla

Thanks
Sunil