From: alex chen Date: Thu, 9 Oct 2014 22:25:00 +0000 (-0700) Subject: ocfs2/dlm: call dlm_lockres_put without resource spinlock X-Git-Tag: v4.9.8~5584^2~149 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9a7e6b5a0ad1a554ca982c555a34ce8086d5b994;p=platform%2Fkernel%2Flinux-rpi3.git ocfs2/dlm: call dlm_lockres_put without resource spinlock dlm_lockres_put() should be called without &res->spinlock, otherwise a deadlock case may happen. spin_lock(&res->spinlock) ... dlm_lockres_put ->dlm_lockres_release ->dlm_print_one_lock_resource ->spin_lock(&res->spinlock) Signed-off-by: Alex Chen Reviewed-by: Joseph Qi Cc: Mark Fasheh Cc: Joel Becker Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/ocfs2/dlm/dlmrecovery.c b/fs/ocfs2/dlm/dlmrecovery.c index 45067fa..3365839 100644 --- a/fs/ocfs2/dlm/dlmrecovery.c +++ b/fs/ocfs2/dlm/dlmrecovery.c @@ -1710,9 +1710,12 @@ int dlm_master_requery_handler(struct o2net_msg *msg, u32 len, void *data, BUG(); } else __dlm_lockres_grab_inflight_worker(dlm, res); - } else /* put.. incase we are not the master */ + spin_unlock(&res->spinlock); + } else { + /* put.. incase we are not the master */ + spin_unlock(&res->spinlock); dlm_lockres_put(res); - spin_unlock(&res->spinlock); + } } spin_unlock(&dlm->spinlock);