[Ocfs2-devel] [PATCH] ocfs2/dlm: remove potential deadlock -V3

Joel Becker Joel.Becker at oracle.com
Sat Aug 7 11:40:28 PDT 2010


On Fri, Jul 30, 2010 at 11:18:00PM +0800, Wengang Wang wrote:
> When we need to take both dlm_domain_lock and dlm->spinlock, we should take
> them in order of: dlm_domain_lock then dlm->spinlock.
> 
> There is pathes disobey this order. That is calling dlm_lockres_put() with
> dlm->spinlock held in dlm_run_purge_list. dlm_lockres_put() calls dlm_put() at
> the ref and dlm_put() locks on dlm_domain_lock.
> 
> Fix:
> Don't grab/put the dlm when the initialising/releasing lockres.
> That grab is not required because we don't call dlm_unregister_domain()
> based on refcount.
> 
> Signed-off-by: Wengang Wang <wen.gang.wang at oracle.com>

This patch is now in the fixes branch of ocfs2.git.

Joel
-- 

"If the human brain were so simple we could understand it, we would
 be so simple that we could not."
	- W. A. Clouston

Joel Becker
Consulting Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127



More information about the Ocfs2-devel mailing list