journal: fix iteration when we go backwards from the beginning of an array chain element

This commit is contained in:
Lennart Poettering 2013-11-27 00:58:39 +01:00
parent f268980d2c
commit e5462cd80e

View file

@ -1687,7 +1687,7 @@ found:
return 0;
/* Let's cache this item for the next invocation */
chain_cache_put(f->chain_cache, ci, first, a, array->entry_array.items[0], t, i + (subtract_one ? -1 : 0));
chain_cache_put(f->chain_cache, ci, first, a, array->entry_array.items[0], t, subtract_one ? (i > 0 ? i-1 : (uint64_t) -1) : i);
if (subtract_one && i == 0)
p = last_p;