Przeglądaj źródła

Don't try and remove a lock from a list if it's not on one, but DO remove
it from the resources list when it gets unlocked.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1376 fd59a12c-fef9-0310-b244-a6a79926bd2f

Patrick Caulfield 18 lat temu
rodzic
commit
5e2605c854
1 zmienionych plików z 8 dodań i 6 usunięć
  1. 8 6
      exec/lck.c

+ 8 - 6
exec/lck.c

@@ -1070,11 +1070,13 @@ void unlock_algorithm (
 	if (resource_lock == resource->ex_granted) {
 		resource->ex_granted = 0;
 	}
-
-	/*
-	 * Delete resource lock from whichever list it is on
-	 */
-	list_del (&resource_lock->list);
+	else {
+		/*
+		 * Delete resource lock from whichever list it is on
+		 */
+		list_del (&resource_lock->list);
+	}
+	list_del (&resource_lock->resource_list);
 
 	/*
 	 * Check if EX locks are available, if so assign one
@@ -1286,7 +1288,7 @@ error_exit:
 				&res_lib_lck_resourceunlockasync,
 				sizeof (struct res_lib_lck_resourceunlockasync));
 			openais_conn_send_response (
-				resource_lock->callback_source.conn,
+				openais_conn_partner_get(resource_lock->callback_source.conn),
 				&res_lib_lck_resourceunlockasync,
 				sizeof (struct res_lib_lck_resourceunlockasync));
 		} else {