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.
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>
(cherry picked from commit
eec0d94f519b3e27f255b9b7a637df043951424e)
Change-Id: Ic6b3ba18c843d1f41c45fa69559bea869620439a
Reviewed-on: http://gerrit.openafs.org/2237
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit
639c0e467af3d78619e11cf44895809e0b9b8edf)
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);