|
Zbigniew Jędrzejewski-Szmek |
d66047 |
From 6ddc0196df2400e440e4bddbcc4ce32c636a7ec1 Mon Sep 17 00:00:00 2001
|
|
Zbigniew Jędrzejewski-Szmek |
d66047 |
From: Lennart Poettering <lennart@poettering.net>
|
|
Zbigniew Jędrzejewski-Szmek |
d66047 |
Date: Wed, 27 Nov 2013 00:58:39 +0100
|
|
Zbigniew Jędrzejewski-Szmek |
d66047 |
Subject: [PATCH] journal: fix iteration when we go backwards from the
|
|
Zbigniew Jędrzejewski-Szmek |
d66047 |
beginning of an array chain element
|
|
Zbigniew Jędrzejewski-Szmek |
d66047 |
|
|
Zbigniew Jędrzejewski-Szmek |
d66047 |
(cherry picked from commit e5462cd80e5328a769137c261c93931ea0c27bab)
|
|
Zbigniew Jędrzejewski-Szmek |
d66047 |
---
|
|
Zbigniew Jędrzejewski-Szmek |
d66047 |
src/journal/journal-file.c | 2 +-
|
|
Zbigniew Jędrzejewski-Szmek |
d66047 |
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
Zbigniew Jędrzejewski-Szmek |
d66047 |
|
|
Zbigniew Jędrzejewski-Szmek |
d66047 |
diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c
|
|
Zbigniew Jędrzejewski-Szmek |
d66047 |
index 02f7554..4e22e08 100644
|
|
Zbigniew Jędrzejewski-Szmek |
d66047 |
--- a/src/journal/journal-file.c
|
|
Zbigniew Jędrzejewski-Szmek |
d66047 |
+++ b/src/journal/journal-file.c
|
|
Zbigniew Jędrzejewski-Szmek |
d66047 |
@@ -1687,7 +1687,7 @@ found:
|
|
Zbigniew Jędrzejewski-Szmek |
d66047 |
return 0;
|
|
Zbigniew Jędrzejewski-Szmek |
d66047 |
|
|
Zbigniew Jędrzejewski-Szmek |
d66047 |
/* Let's cache this item for the next invocation */
|
|
Zbigniew Jędrzejewski-Szmek |
d66047 |
- chain_cache_put(f->chain_cache, ci, first, a, array->entry_array.items[0], t, i + (subtract_one ? -1 : 0));
|
|
Zbigniew Jędrzejewski-Szmek |
d66047 |
+ 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);
|
|
Zbigniew Jędrzejewski-Szmek |
d66047 |
|
|
Zbigniew Jędrzejewski-Szmek |
d66047 |
if (subtract_one && i == 0)
|
|
Zbigniew Jędrzejewski-Szmek |
d66047 |
p = last_p;
|