From: Jens Axboe Date: Tue, 1 Jul 2014 14:47:11 +0000 (-0600) Subject: client: fix missing pdu->log_offset endianness conversion X-Git-Tag: fio-2.1.11~38 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=3c865f32245c57635c59bc4e06f0e615d29aecbe;p=fio.git client: fix missing pdu->log_offset endianness conversion Make the iolog sample number uint64_t as well, so we have the same size across 32 and 64-bit archs. Signed-off-by: Jens Axboe --- diff --git a/client.c b/client.c index 4587824b..6e7ed6d5 100644 --- a/client.c +++ b/client.c @@ -1154,9 +1154,9 @@ static struct cmd_iolog_pdu *convert_iolog_gz(struct fio_net_cmd *cmd, /* * Get header first, it's not compressed */ - nr_samples = le32_to_cpu(pdu->nr_samples); + nr_samples = le64_to_cpu(pdu->nr_samples); - total = nr_samples * __log_entry_sz(pdu->log_offset); + total = nr_samples * __log_entry_sz(le32_to_cpu(pdu->log_offset)); ret = malloc(total + sizeof(*pdu)); ret->nr_samples = nr_samples; diff --git a/iolog.h b/iolog.h index b387f48d..eed92971 100644 --- a/iolog.h +++ b/iolog.h @@ -48,8 +48,8 @@ struct io_log { /* * Entries already logged */ - unsigned long nr_samples; - unsigned long max_samples; + uint64_t nr_samples; + uint64_t max_samples; void *log; unsigned int log_type;