]> git.proxmox.com Git - mirror_corosync.git/commit
schedwrk: Cleanup and make it work on PPC BE
authorJan Friesse <jfriesse@redhat.com>
Fri, 13 May 2016 15:06:09 +0000 (17:06 +0200)
committerJan Friesse <jfriesse@redhat.com>
Tue, 17 May 2016 14:29:25 +0000 (16:29 +0200)
commitb93d75abc4b3b566e6456513ea53676fbe6ca496
tree4495b4b424dd993bd6dc46e00344b9fe7ab80b01
parent8ab7743068cc6cd5bf235d1ccae65de1d91784f0
schedwrk: Cleanup and make it work on PPC BE

Schedwrk is passing hdb handle (64-bit) to
totempg_callback_token_create as a context. Context is defined to be
pointer, so there is conversion function which stores 64-bit hdb_handle
into pointer. Potentially, pointer can be 32-bit. This means, check
part of hdb is discarded (and have to get special no_check value in
schedwrk_do) later. This works quite well on 32-bit Little-Endian
system. Sadly on Big-Endian system, check partition of hdb is stored
instead of value. Result is error of hdb_handle_get call.

Proposed solution is to pass handle pointer to
totempg_callback_token_create as context. This means full hdb (check +
value) can be used in schedwrk_do (easier detection of memory
corruption).

Main reason for this patch is to remove usage of pointer as integer
value.

Small drawback of given solution is that handle pointer must be memory
allocated on heap or static memory, making API more bug-prone. Current
usage of schedwrk API across corosync always use memory in .text
section (safe), so it's not a problem.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
exec/schedwrk.c