libctdb: use magic to detect free/invalid locks
authorRusty Russell <rusty@rustcorp.com.au>
Tue, 8 Jun 2010 07:22:23 +0000 (16:52 +0930)
committerRusty Russell <rusty@rustcorp.com.au>
Tue, 8 Jun 2010 07:22:23 +0000 (16:52 +0930)
commitdc081d40051b9204bb38e4de7dfe8d78656593d0
treedbabf90d16866e6069c1acbf18b0331c4266d5e2
parentb977901a49a9fed45cc8a2fe880eb749f58278f6
libctdb: use magic to detect free/invalid locks

Rather than using a binary, we use a magic value for locking.  We also
split out the "dont have the lock yet" from the "do have the lock"
paths for clarity and extra checking.

This should detect a superset of the previous case, even if they free
(and reuse) the lock memory.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
libctdb/ctdb.c