ocfs2/dlm: fix a dead lock
commitea156ca43e1daf741590124281f9ba9c7ee61c79
authorWengang Wang <wen.gang.wang@oracle.com>
Fri, 16 Jul 2010 15:13:33 +0000 (16 23:13 +0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 26 Aug 2010 23:43:18 +0000 (26 16:43 -0700)
tree5e5d8c3a71b66120851a8f274d2e12aa66942b4c
parent9c03fdacc7f541bc3dd67af0955f8e90eadc8c6e
ocfs2/dlm: fix a dead lock

commit 6d98c3ccb52f692f1a60339dde7c700686a5568b upstream.

When we have to take both dlm->master_lock and lockres->spinlock,
take them in order

lockres->spinlock and then dlm->master_lock.

The patch fixes a violation of the rule.
We can simply move taking dlm->master_lock to where we have dropped res->spinlock
since when we access res->state and free mle memory we don't need master_lock's
protection.

Signed-off-by: Wengang Wang <wen.gang.wang@oracle.com>
Signed-off-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/ocfs2/dlm/dlmmaster.c