From 6aa72dae8fc341de5b497f831ded1f8f519fa8fb Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Mon, 18 Apr 2011 22:15:11 +0930 Subject: tdb: fix transaction recovery area for converted tdbs. This is why macros are dangerous; these were converting the pointers, not the things pointed to! Signed-off-by: Rusty Russell --- lib/tdb/common/transaction.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/tdb/common/transaction.c b/lib/tdb/common/transaction.c index c49de3877c..4bc8044219 100644 --- a/lib/tdb/common/transaction.c +++ b/lib/tdb/common/transaction.c @@ -786,7 +786,7 @@ static int transaction_setup_recovery(struct tdb_context *tdb, rec->data_len = recovery_size; rec->rec_len = recovery_max_size; rec->key_len = old_map_size; - CONVERT(rec); + CONVERT(*rec); /* build the recovery data into a single blob to allow us to do a single large write, which should be more efficient */ @@ -833,7 +833,9 @@ static int transaction_setup_recovery(struct tdb_context *tdb, /* and the tailer */ tailer = sizeof(*rec) + recovery_max_size; memcpy(p, &tailer, 4); - CONVERT(p); + if (DOCONV()) { + tdb_convert(p, 4); + } /* write the recovery data to the recovery area */ if (methods->tdb_write(tdb, recovery_offset, data, sizeof(*rec) + recovery_size) == -1) { -- cgit