LogoopenSUSE Build Service > Projects
Sign Up | Log In

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

commit aa4bde63a2307636f5f64c03082aab80eb6dd27e
Author: David Teigland <teigland@redhat.com>
Date:   Fri Aug 13 15:50:31 2010 -0500

    gfs_controld: fix plock owner syncing
    
    - The R_GOT_UNOWN flag was not always being set on resources when
    the owner was set to 0.  This would cause subsequent syncing of
    plock state to write the incorrect owner into the checkpoint.
    
    bz 617306
    
    Signed-off-by: David Teigland <teigland@redhat.com>

diff --git a/group/gfs_controld/plock.c b/group/gfs_controld/plock.c
index 710e73a..e487d41 100644
--- a/group/gfs_controld/plock.c
+++ b/group/gfs_controld/plock.c
@@ -1692,10 +1692,13 @@ static int unpack_section_buf(struct mountgroup *mg, char *numbuf, int buflen)
 	INIT_LIST_HEAD(&r->waiters);
 	INIT_LIST_HEAD(&r->pending);
 
-	if (cfgd_plock_ownership)
+	if (cfgd_plock_ownership) {
 		sscanf(numbuf, "r%llu.%d", &num, &owner);
-	else
+		if (!owner)
+			r->flags |= R_GOT_UNOWN;
+	} else {
 		sscanf(numbuf, "r%llu", &num);
+	}
 
 	r->number = num;
 	r->owner = owner;
@@ -2175,6 +2178,7 @@ void purge_plocks(struct mountgroup *mg, int nodeid, int unmount)
 
 		if (r->owner == nodeid) {
 			r->owner = 0;
+			r->flags |= R_GOT_UNOWN;
 			send_pending_plocks(mg, r);
 		}