From 20c7a244e75e4aa705a31a74e7067de4c890dff7 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Mon, 31 Aug 2020 09:07:12 -0600 Subject: [PATCH] options: flow should parse as FIO_OPT_INT It's an unsigned int, if we parse it as FIO_OPT_ULL then we clobber the variable around it in the options struct. This is apparent when running the examples/flow.fio job file, as flow_sleep=1000 is set before flow, but gets clobbered when flow is set. This results in a flow_sleep value of 0 instead of 1000. Fixes: d4e74fda98b6 ("flow: add ability for weight-based flow control on multiple jobs") Signed-off-by: Jens Axboe --- cconv.c | 4 ++-- options.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cconv.c b/cconv.c index f37e5161..5dc0569f 100644 --- a/cconv.c +++ b/cconv.c @@ -281,7 +281,7 @@ void convert_thread_options_to_cpu(struct thread_options *o, o->uid = le32_to_cpu(top->uid); o->gid = le32_to_cpu(top->gid); o->flow_id = __le32_to_cpu(top->flow_id); - o->flow = __le32_to_cpu(top->flow); + o->flow = le32_to_cpu(top->flow); o->flow_sleep = le32_to_cpu(top->flow_sleep); o->sync_file_range = le32_to_cpu(top->sync_file_range); o->latency_target = le64_to_cpu(top->latency_target); @@ -480,7 +480,7 @@ void convert_thread_options_to_net(struct thread_options_pack *top, top->uid = cpu_to_le32(o->uid); top->gid = cpu_to_le32(o->gid); top->flow_id = __cpu_to_le32(o->flow_id); - top->flow = __cpu_to_le32(o->flow); + top->flow = cpu_to_le32(o->flow); top->flow_sleep = cpu_to_le32(o->flow_sleep); top->sync_file_range = cpu_to_le32(o->sync_file_range); top->latency_target = __cpu_to_le64(o->latency_target); diff --git a/options.c b/options.c index 067597ec..0d64e7c0 100644 --- a/options.c +++ b/options.c @@ -4696,7 +4696,7 @@ struct fio_option fio_options[FIO_MAX_OPTS] = { { .name = "flow", .lname = "I/O flow weight", - .type = FIO_OPT_ULL, + .type = FIO_OPT_INT, .off1 = offsetof(struct thread_options, flow), .help = "Weight for flow control of this job", .parent = "flow_id", -- 2.25.1