From: Lidong Zhong Date: Fri, 9 May 2014 16:46:25 +0800 Subject: [Cluster-devel] [PATCH 1/1] dlm_controld: fix deadlock when nodes without quorum stop services Message-ID: <1399625185-7458-1-git-send-email-lzhong@suse.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit When nodes without quorum start to stop services, node which releases lockspace slower will be hang(because of a deadlock in kernel) until quorum comes back while the one releases faster could stop successfuly. It leads to a different behavior. please refer to https://bugzilla.novell.com/show_bug.cgi?id=874705 for detail. Signed-off-by: Lidong Zhong Signed-off-by: Xia Li --- dlm_controld/cpg.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/dlm_controld/cpg.c b/dlm_controld/cpg.c index f971158..754a852 100644 --- a/dlm_controld/cpg.c +++ b/dlm_controld/cpg.c @@ -1261,6 +1261,19 @@ void process_lockspace_changes(void) poll_fs = 0; list_for_each_entry_safe(ls, safe, &lockspaces, list) { + if (ls->leaving && !(opt(enable_quorum_lockspace_ind) + && !cluster_quorate)) { + log_group(ls, "confchg for our leave"); + stop_kernel(ls, 0); + set_configfs_members(ls, ls->name, 0, NULL, 0, NULL); + set_sysfs_event_done(ls->name, 0); + cpg_finalize(ls->cpg_handle); + client_dead(ls->cpg_client); + purge_plocks(ls, our_nodeid, 1); + list_del(&ls->list); + free_ls(ls); + return; + } if (!list_empty(&ls->changes)) apply_changes(ls); } @@ -1414,7 +1427,10 @@ static void confchg_cb(cpg_handle_t handle, return; } - if (ls->leaving && we_left(left_list, left_list_entries)) { + /* check currently if we have quorum in order to keep the + same behavior with other nodes */ + if (ls->leaving && we_left(left_list, left_list_entries) + && !(opt(enable_quorum_lockspace_ind) && !cluster_quorate)) { /* we called cpg_leave(), and this should be the final cpg callback we receive */ log_group(ls, "confchg for our leave"); -- 1.8.1.4