LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File dlm_controld_fix_plock_signature_in_stored_message.patch of Package cluster (Project home:sschapiro:openstack:upstream)

commit 4528ab5583ae25910b82795884520033651fc405
Author: David Teigland <teigland@redhat.com>
Date:   Thu Aug 12 14:51:02 2010 -0500

    dlm_controld: fix plock signature in stored message
    
    When confchg's change the ckpt_node between plock checkpoints
    being written, and the plocks_stored message being received,
    the plocks_stored message is resent by the new ckpt_node that
    didn't write the checkpoint.
    
    The new ckpt_node needs to save the plock checkpoint signature
    that was sent in the first plocks_stored message from the
    checkpoint writer, and reuse it when sending the new
    plocks_stored method.  Otherwise the plock signature in the
    stored message will be invalid.
    
    bz 623816
    
    Signed-off-by: David Teigland <teigland@redhat.com>

diff --git a/group/dlm_controld/cpg.c b/group/dlm_controld/cpg.c
index a9cc61e..899d23e 100644
--- a/group/dlm_controld/cpg.c
+++ b/group/dlm_controld/cpg.c
@@ -1099,6 +1099,8 @@ static void receive_plocks_stored(struct lockspace *ls, struct dlm_header *hd,
 		  "need_plocks %d", hd->nodeid, hd->msgdata, hd->flags,
 		  hd->msgdata2, ls->need_plocks);
 
+	ls->last_plock_sig = hd->msgdata2;
+
 	if (!ls->need_plocks)
 		return;
 
@@ -1329,8 +1331,12 @@ static void prepare_plocks(struct lockspace *ls)
 	   the previous stored message.  They will read the ckpt from the
 	   previous ckpt_node upon receiving the stored message from us. */
 
-	if (nodes_added(ls))
+	if (nodes_added(ls)) {
 		store_plocks(ls, &sig);
+		ls->last_plock_sig = sig;
+	} else {
+		sig = ls->last_plock_sig;
+	}
 	send_plocks_stored(ls, sig);
 }
 
diff --git a/group/dlm_controld/dlm_daemon.h b/group/dlm_controld/dlm_daemon.h
index c2423d2..6f7711a 100644
--- a/group/dlm_controld/dlm_daemon.h
+++ b/group/dlm_controld/dlm_daemon.h
@@ -220,6 +220,7 @@ struct lockspace {
 	uint64_t		checkpoint_r_num_last;
 	uint32_t		checkpoint_r_count;
 	uint32_t		checkpoint_p_count;
+	uint32_t		last_plock_sig;
 
 	/* save copy of groupd member callback data for queries */