Commit 59e8cd6b authored by Marek Vavruša's avatar Marek Vavruša

journal: skip invalid nodes on fetch

parent 669aa329
......@@ -600,6 +600,12 @@ static int journal_fetch(journal_t *journal, uint64_t id,
size_t endp = jnode_prev(journal, journal->qhead);
for(; i != endp; i = jnode_prev(journal, i)) {
journal_node_t *n = journal->nodes + i;
/* Skip invalid nodes. */
if (!(n->flags & JOURNAL_VALID)) {
continue;
}
if (cf(n->id, id) == 0) {
*dst = journal->nodes + i;
return KNOT_EOK;
......@@ -964,12 +970,6 @@ static int journal_walk(const char *fn, uint32_t from, uint32_t to,
break;
}
/* Skip wrong changesets. */
if (!(n->flags & JOURNAL_VALID)) {
++n;
continue;
}
/* Callback. */
ret = cb(journal, n, zone, chgs);
if (ret != KNOT_EOK) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment