When attempting to read the replay log, ubik was not ntohl'ing all
integers that were read in from the log, causing the log to appear
invalid on little-endian systems. Fix it.
This problem manifests as apparent corruption in the database on top
of ubik when a commit is occurring when we are shut down, or a disk
error is encountered during a commit.
Change-Id: I82e04c59d0f55aa2105b02feb6ee332ea85eb4f3
Reviewed-on: http://gerrit.openafs.org/2224
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
sizeof(afs_int32));
if (code != sizeof(afs_int32))
break;
+ opcode = ntohl(opcode);
if (opcode == LOGNEW) {
/* handle begin trans */
tpos += sizeof(afs_int32);
if (code != 3 * sizeof(afs_int32))
break;
/* otherwise, skip over the data bytes, too */
- tpos += buffer[2] + 3 * sizeof(afs_int32);
+ tpos += ntohl(buffer[2]) + 3 * sizeof(afs_int32);
} else {
ubik_dprint("corrupt log opcode (%d) at position %d\n", opcode,
tpos);
sizeof(afs_int32));
if (code != sizeof(afs_int32))
break;
+ opcode = ntohl(opcode);
if (opcode == LOGNEW) {
/* handle begin trans */
tpos += sizeof(afs_int32);