Re: [systemd-devel] [PATCH] journal: Add missing byte order conversions

2014-01-05 Thread Zbigniew Jędrzejewski-Szmek
On Tue, Dec 31, 2013 at 02:37:32PM -0600, George McCollister wrote:
> Convert entry_array.items[0] to host byte order prior to passing it to
> chain_cache_put().
Applied.

> Signed-off-by: George McCollister 
No need for this.

> --- a/src/journal/journal-file.c
> +++ b/src/journal/journal-file.c
> @@ -1452,7 +1452,7 @@ static int generic_array_get(
>  
>  found:
>  /* Let's cache this item for the next invocation */
> -chain_cache_put(f->chain_cache, ci, first, a, 
> o->entry_array.items[0], t, i);
> +chain_cache_put(f->chain_cache, ci, first, a, 
> le64toh(o->entry_array.items[0]), t, i);
I applied the same treatment to journal-verify.c. Can you check how
journalctl --verify behaves for you?

Zbyszek
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH] journal: Add missing byte order conversions

2013-12-31 Thread George McCollister
Convert entry_array.items[0] to host byte order prior to passing it to
chain_cache_put().

Signed-off-by: George McCollister 
---
 src/journal/journal-file.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c
index 121b40a..275324b 100644
--- a/src/journal/journal-file.c
+++ b/src/journal/journal-file.c
@@ -1452,7 +1452,7 @@ static int generic_array_get(
 
 found:
 /* Let's cache this item for the next invocation */
-chain_cache_put(f->chain_cache, ci, first, a, o->entry_array.items[0], 
t, i);
+chain_cache_put(f->chain_cache, ci, first, a, 
le64toh(o->entry_array.items[0]), t, i);
 
 r = journal_file_move_to_object(f, OBJECT_ENTRY, p, &o);
 if (r < 0)
@@ -1685,7 +1685,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, subtract_one ? (i > 0 ? i-1 : (uint64_t) -1) : 
i);
+chain_cache_put(f->chain_cache, ci, first, a, 
le64toh(array->entry_array.items[0]), t, subtract_one ? (i > 0 ? i-1 : 
(uint64_t) -1) : i);
 
 if (subtract_one && i == 0)
 p = last_p;
-- 
1.8.2.1

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel