for (uint64_t i = 0; i < n; i++) {
uint64_t l, h;
- le64_t le_hash;
size_t t;
void *data;
Object *u;
q = le64toh(o->entry.items[i].object_offset);
- le_hash = o->entry.items[i].hash;
r = journal_file_move_to_object(from, OBJECT_DATA, q, &o);
if (r < 0)
return r;
- if (le_hash != o->data.hash)
- return -EBADMSG;
-
l = le64toh(READ_NOW(o->object.size));
if (l < offsetof(Object, data.payload))
return -EBADMSG;
n = journal_file_entry_n_items(o);
for (i = 0; i < n; i++) {
- uint64_t q, h;
+ uint64_t q;
Object *u;
q = le64toh(o->entry.items[i].object_offset);
- h = le64toh(o->entry.items[i].hash);
if (!contains_uint64(cache_data_fd, n_data, q)) {
error(p, "Invalid data object of entry");
if (r < 0)
return r;
- if (le64toh(u->data.hash) != h) {
- error(p, "Hash mismatch for data object of entry");
- return -EBADMSG;
- }
-
- r = data_object_in_hash_table(f, h, q);
+ r = data_object_in_hash_table(f, le64toh(u->data.hash), q);
if (r < 0)
return r;
if (r == 0) {
for (i = 0; i < n; i++) {
Object *d;
uint64_t p, l;
- le64_t le_hash;
size_t t;
int compression;
p = le64toh(o->entry.items[i].object_offset);
- le_hash = o->entry.items[i].hash;
r = journal_file_move_to_object(f, OBJECT_DATA, p, &d);
if (IN_SET(r, -EADDRNOTAVAIL, -EBADMSG)) {
log_debug_errno(r, "Entry item %"PRIu64" data object is bad, skipping over it: %m", i);
if (r < 0)
return r;
- if (le_hash != d->data.hash) {
- log_debug("Entry item %"PRIu64" hash is bad, skipping over it.", i);
- continue;
- }
-
l = le64toh(d->object.size) - offsetof(Object, data.payload);
compression = d->object.flags & OBJECT_COMPRESSION_MASK;
for (uint64_t n = journal_file_entry_n_items(o); j->current_field < n; j->current_field++) {
uint64_t p;
- le64_t le_hash;
p = le64toh(o->entry.items[j->current_field].object_offset);
- le_hash = o->entry.items[j->current_field].hash;
r = journal_file_move_to_object(f, OBJECT_DATA, p, &o);
if (IN_SET(r, -EADDRNOTAVAIL, -EBADMSG)) {
log_debug_errno(r, "Entry item %"PRIu64" data object is bad, skipping over it: %m", j->current_field);
if (r < 0)
return r;
- if (le_hash != o->data.hash) {
- log_debug("Entry item %"PRIu64" hash is bad, skipping over it.", j->current_field);
- continue;
- }
-
r = return_data(j, f, o, data, size);
if (r == -EBADMSG) {
log_debug("Entry item %"PRIu64" data payload is bad, skipping over it.", j->current_field);