Fix server/client set_options conversion
authorJens Axboe <axboe@fb.com>
Tue, 9 Dec 2014 21:12:47 +0000 (14:12 -0700)
committerJens Axboe <axboe@fb.com>
Tue, 9 Dec 2014 21:12:47 +0000 (14:12 -0700)
Signed-off-by: Jens Axboe <axboe@fb.com>
cconv.c
server.h

diff --git a/cconv.c b/cconv.c
index 18edc0f30d8a22fefc92e3a28d01a3c4d2301240..0de2f5c7fd6e177081da95ef90e06c3e4eff574b 100644 (file)
--- a/cconv.c
+++ b/cconv.c
@@ -49,7 +49,9 @@ void convert_thread_options_to_cpu(struct thread_options *o,
 {
        int i, j;
 
 {
        int i, j;
 
-       memcpy(o->set_options, top->set_options, NR_OPTS_SZ * sizeof(uint64_t));
+       for (i = 0; i < NR_OPTS_SZ; i++)
+               o->set_options[i] = le64_to_cpu(top->set_options[i]);
+
        string_to_cpu(&o->description, top->description);
        string_to_cpu(&o->name, top->name);
        string_to_cpu(&o->directory, top->directory);
        string_to_cpu(&o->description, top->description);
        string_to_cpu(&o->name, top->name);
        string_to_cpu(&o->directory, top->directory);
@@ -257,7 +259,9 @@ void convert_thread_options_to_net(struct thread_options_pack *top,
 {
        int i, j;
 
 {
        int i, j;
 
-       memcpy(top->set_options, o->set_options, NR_OPTS_SZ * sizeof(uint64_t));
+       for (i = 0; i < NR_OPTS_SZ; i++)
+               top->set_options[i] = cpu_to_le64(o->set_options[i]);
+
        string_to_net(top->description, o->description);
        string_to_net(top->name, o->name);
        string_to_net(top->directory, o->directory);
        string_to_net(top->description, o->description);
        string_to_net(top->name, o->name);
        string_to_net(top->directory, o->directory);
index 0a98bf5bb25e56c94402a981e575ff29620a45bd..cd3f999384120f41e70e205d61a2f2715f99b8ac 100644 (file)
--- a/server.h
+++ b/server.h
@@ -38,7 +38,7 @@ struct fio_net_cmd_reply {
 };
 
 enum {
 };
 
 enum {
-       FIO_SERVER_VER                  = 40,
+       FIO_SERVER_VER                  = 41,
 
        FIO_SERVER_MAX_FRAGMENT_PDU     = 1024,
        FIO_SERVER_MAX_CMD_MB           = 2048,
 
        FIO_SERVER_MAX_FRAGMENT_PDU     = 1024,
        FIO_SERVER_MAX_CMD_MB           = 2048,