summaryrefslogtreecommitdiff
path: root/server.h
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2013-11-08 10:57:08 -0700
committerJens Axboe <axboe@kernel.dk>2013-11-08 10:57:08 -0700
commit5054e67c7d87f25a9eb7b647adaee5e1c9c7cc5b (patch)
tree632334186ab923780686bd7ac456f8ac0ea0e620 /server.h
parent6348b5dee54f24f2e78872948653942336f4c14e (diff)
downloadfio-5054e67c7d87f25a9eb7b647adaee5e1c9c7cc5b.tar.gz
Fix access-outside-array of o->rwmix[]
gcc 4.9 rightfully complains about it, though in a very obtuse way: CC cconv.o In file included from thread_options.h:5:0, from cconv.c:3: cconv.c: In function 'convert_thread_options_to_cpu': os/os.h:197:16: warning: iteration 2u invokes undefined behavior [-Waggressive-loop-optimizations] __le32_to_cpu(*__val); \ ^ os/os.h:176:28: note: in definition of macro '__le32_to_cpu' #define __le32_to_cpu(x) (x) ^ cconv.c:78:17: note: in expansion of macro 'le32_to_cpu' o->rwmix[i] = le32_to_cpu(top->rwmix[i]); ^ cconv.c:63:2: note: containing loop for (i = 0; i < DDIR_RWDIR_CNT; i++) { ^ In file included from thread_options.h:5:0, from cconv.c:3: cconv.c: In function 'convert_thread_options_to_net': os/os.h:209:16: warning: iteration 2u invokes undefined behavior [-Waggressive-loop-optimizations] __cpu_to_le32(*__val); \ ^ os/os.h:179:28: note: in definition of macro '__cpu_to_le32' #define __cpu_to_le32(x) (x) ^ cconv.c:372:19: note: in expansion of macro 'cpu_to_le32' top->rwmix[i] = cpu_to_le32(o->rwmix[i]); ^ cconv.c:352:2: note: containing loop for (i = 0; i < DDIR_RWDIR_CNT; i++) { ^ In file included from thread_options.h:5:0, from cconv.c:3: cconv.c: In function 'fio_test_cconv': os/os.h:209:16: warning: iteration 2u invokes undefined behavior [-Waggressive-loop-optimizations] __cpu_to_le32(*__val); \ ^ os/os.h:179:28: note: in definition of macro '__cpu_to_le32' #define __cpu_to_le32(x) (x) ^ cconv.c:372:19: note: in expansion of macro 'cpu_to_le32' top->rwmix[i] = cpu_to_le32(o->rwmix[i]); ^ cconv.c:352:2: note: containing loop for (i = 0; i < DDIR_RWDIR_CNT; i++) { ^ In file included from thread_options.h:5:0, from cconv.c:3: os/os.h:197:16: warning: iteration 2u invokes undefined behavior [-Waggressive-loop-optimizations] __le32_to_cpu(*__val); \ ^ os/os.h:176:28: note: in definition of macro '__le32_to_cpu' #define __le32_to_cpu(x) (x) ^ cconv.c:78:17: note: in expansion of macro 'le32_to_cpu' o->rwmix[i] = le32_to_cpu(top->rwmix[i]); ^ cconv.c:63:2: note: containing loop for (i = 0; i < DDIR_RWDIR_CNT; i++) { ^ Fix it by extending the rwmix indexes to the full rwdir count, even though it doesn't support trim as part of the mix (yet). Reported-by: Bruce Cran <bruce@cran.org.uk> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'server.h')
-rw-r--r--server.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/server.h b/server.h
index aefd4183..5d9b6cca 100644
--- a/server.h
+++ b/server.h
@@ -38,7 +38,7 @@ struct fio_net_cmd_reply {
};
enum {
- FIO_SERVER_VER = 25,
+ FIO_SERVER_VER = 26,
FIO_SERVER_MAX_FRAGMENT_PDU = 1024,