Blame SOURCES/0001-thread_options-Use-unsigned-int-type-for-exit_what-a.patch

701e7e
From fd56c235caa42870e6dc33d661514375ea95ffc5 Mon Sep 17 00:00:00 2001
701e7e
From: =?UTF-8?q?Andr=C3=A9=20Wild?= <wild.andre.ae@gmail.com>
701e7e
Date: Fri, 14 Aug 2020 15:52:09 +0200
701e7e
Subject: [PATCH] thread_options: Use unsigned int type for exit_what and
701e7e
 stonewall
701e7e
MIME-Version: 1.0
701e7e
Content-Type: text/plain; charset=UTF-8
701e7e
Content-Transfer-Encoding: 8bit
701e7e
701e7e
Fixes: 64402a8 ("Expand choices for exitall")
701e7e
Fixes: https://github.com/axboe/fio/issues/1065
701e7e
Signed-off-by: André Wild <wild.andre.ae@gmail.com>
701e7e
---
701e7e
 cconv.c               |  8 ++++----
701e7e
 examples/exitwhat.fio |  8 ++++----
701e7e
 fio.1                 | 29 +++++++++++++++++++++--------
701e7e
 server.h              |  2 +-
701e7e
 thread_options.h      |  9 ++++-----
701e7e
 5 files changed, 34 insertions(+), 22 deletions(-)
701e7e
701e7e
diff --git a/cconv.c b/cconv.c
701e7e
index 2469389b..4b0c3490 100644
701e7e
--- a/cconv.c
701e7e
+++ b/cconv.c
701e7e
@@ -237,8 +237,8 @@ void convert_thread_options_to_cpu(struct thread_options *o,
701e7e
 	o->loops = le32_to_cpu(top->loops);
701e7e
 	o->mem_type = le32_to_cpu(top->mem_type);
701e7e
 	o->mem_align = le32_to_cpu(top->mem_align);
701e7e
-	o->exit_what = le16_to_cpu(top->exit_what);
701e7e
-	o->stonewall = le16_to_cpu(top->stonewall);
701e7e
+	o->exit_what = le32_to_cpu(top->exit_what);
701e7e
+	o->stonewall = le32_to_cpu(top->stonewall);
701e7e
 	o->new_group = le32_to_cpu(top->new_group);
701e7e
 	o->numjobs = le32_to_cpu(top->numjobs);
701e7e
 	o->cpus_allowed_policy = le32_to_cpu(top->cpus_allowed_policy);
701e7e
@@ -437,8 +437,8 @@ void convert_thread_options_to_net(struct thread_options_pack *top,
701e7e
 	top->loops = cpu_to_le32(o->loops);
701e7e
 	top->mem_type = cpu_to_le32(o->mem_type);
701e7e
 	top->mem_align = cpu_to_le32(o->mem_align);
701e7e
-	top->exit_what = cpu_to_le16(o->exit_what);
701e7e
-	top->stonewall = cpu_to_le16(o->stonewall);
701e7e
+	top->exit_what = cpu_to_le32(o->exit_what);
701e7e
+	top->stonewall = cpu_to_le32(o->stonewall);
701e7e
 	top->new_group = cpu_to_le32(o->new_group);
701e7e
 	top->numjobs = cpu_to_le32(o->numjobs);
701e7e
 	top->cpus_allowed_policy = cpu_to_le32(o->cpus_allowed_policy);
701e7e
diff --git a/examples/exitwhat.fio b/examples/exitwhat.fio
701e7e
index a1099f0f..c91d7375 100644
701e7e
--- a/examples/exitwhat.fio
701e7e
+++ b/examples/exitwhat.fio
701e7e
@@ -1,7 +1,7 @@
701e7e
 # We want to run fast1 as long as slow1 is running, but also have a cumulative
701e7e
 # report of fast1 (group_reporting=1/new_group=1).  exitall=1 would not cause
701e7e
 # fast1 to stop after slow1 is done. Setting exit_what=stonewall will cause
701e7e
-# alls jobs up until the next stonewall=1 setting to be stopped, when job slow1
701e7e
+# alls jobs up until the next stonewall setting to be stopped, when job slow1
701e7e
 # finishes.
701e7e
 # In this example skipping forward to slow2/fast2. slow2 has exit_what=all set,
701e7e
 # which means all jobs will be cancelled when slow2 finishes. In particular,
701e7e
@@ -15,7 +15,7 @@ group_reporting=1
701e7e
 exitall=1
701e7e
 
701e7e
 [slow1]
701e7e
-rw=r
701e7e
+rw=read
701e7e
 numjobs=1
701e7e
 ioengine=sync
701e7e
 new_group=1
701e7e
@@ -32,8 +32,8 @@ iodepth=32
701e7e
 rate=300,300,300
701e7e
 
701e7e
 [slow2]
701e7e
-stonewall=1
701e7e
-rw=w
701e7e
+stonewall
701e7e
+rw=write
701e7e
 numjobs=1
701e7e
 ioengine=sync
701e7e
 new_group=1
701e7e
diff --git a/fio.1 b/fio.1
701e7e
index cdd105d7..1c90e4a5 100644
701e7e
--- a/fio.1
701e7e
+++ b/fio.1
701e7e
@@ -2569,7 +2569,8 @@ been exceeded before retrying operations.
701e7e
 Wait for preceding jobs in the job file to exit, before starting this
701e7e
 one. Can be used to insert serialization points in the job file. A stone
701e7e
 wall also implies starting a new reporting group, see
701e7e
-\fBgroup_reporting\fR.
701e7e
+\fBgroup_reporting\fR. Optionally you can use `stonewall=0` to disable or
701e7e
+`stonewall=1` to enable it.
701e7e
 .TP
701e7e
 .BI exitall
701e7e
 By default, fio will continue running all other jobs when one job finishes.
701e7e
@@ -2577,15 +2578,27 @@ Sometimes this is not the desired action. Setting \fBexitall\fR will instead
701e7e
 make fio terminate all jobs in the same group, as soon as one job of that
701e7e
 group finishes.
701e7e
 .TP
701e7e
-.BI exit_what
701e7e
+.BI exit_what \fR=\fPstr
701e7e
 By default, fio will continue running all other jobs when one job finishes.
701e7e
-Sometimes this is not the desired action. Setting \fBexit_all\fR will instead
701e7e
+Sometimes this is not the desired action. Setting \fBexitall\fR will instead
701e7e
 make fio terminate all jobs in the same group. The option \fBexit_what\fR
701e7e
-allows to control which jobs get terminated when \fBexitall\fR is enabled. The
701e7e
-default is \fBgroup\fR and does not change the behaviour of \fBexitall\fR. The
701e7e
-setting \fBall\fR terminates all jobs. The setting \fBstonewall\fR terminates
701e7e
-all currently running jobs across all groups and continues execution with the
701e7e
-next stonewalled group.
701e7e
+allows you to control which jobs get terminated when \fBexitall\fR is enabled.
701e7e
+The default value is \fBgroup\fR.
701e7e
+The allowed values are:
701e7e
+.RS
701e7e
+.RS
701e7e
+.TP
701e7e
+.B all
701e7e
+terminates all jobs.
701e7e
+.TP
701e7e
+.B group
701e7e
+is the default and does not change the behaviour of \fBexitall\fR.
701e7e
+.TP
701e7e
+.B stonewall
701e7e
+terminates all currently running jobs across all groups and continues
701e7e
+execution with the next stonewalled group.
701e7e
+.RE
701e7e
+.RE
701e7e
 .TP
701e7e
 .BI exec_prerun \fR=\fPstr
701e7e
 Before running this job, issue the command specified through
701e7e
diff --git a/server.h b/server.h
701e7e
index de01a5c8..efa70e7c 100644
701e7e
--- a/server.h
701e7e
+++ b/server.h
701e7e
@@ -48,7 +48,7 @@ struct fio_net_cmd_reply {
701e7e
 };
701e7e
 
701e7e
 enum {
701e7e
-	FIO_SERVER_VER			= 83,
701e7e
+	FIO_SERVER_VER			= 84,
701e7e
 
701e7e
 	FIO_SERVER_MAX_FRAGMENT_PDU	= 1024,
701e7e
 	FIO_SERVER_MAX_CMD_MB		= 2048,
701e7e
diff --git a/thread_options.h b/thread_options.h
701e7e
index 3fe48ecc..14f1cbe9 100644
701e7e
--- a/thread_options.h
701e7e
+++ b/thread_options.h
701e7e
@@ -202,8 +202,8 @@ struct thread_options {
701e7e
 
701e7e
 	unsigned long long max_latency;
701e7e
 
701e7e
-	unsigned short exit_what;
701e7e
-	unsigned short stonewall;
701e7e
+	unsigned int exit_what;
701e7e
+	unsigned int stonewall;
701e7e
 	unsigned int new_group;
701e7e
 	unsigned int numjobs;
701e7e
 	os_cpu_mask_t cpumask;
701e7e
@@ -494,8 +494,8 @@ struct thread_options_pack {
701e7e
 	uint32_t mem_type;
701e7e
 	uint32_t mem_align;
701e7e
 
701e7e
-	uint16_t exit_what;
701e7e
-	uint16_t stonewall;
701e7e
+	uint32_t exit_what;
701e7e
+	uint32_t stonewall;
701e7e
 	uint32_t new_group;
701e7e
 	uint32_t numjobs;
701e7e
 	/*
701e7e
@@ -546,7 +546,6 @@ struct thread_options_pack {
701e7e
 	uint32_t lat_percentiles;
701e7e
 	uint32_t slat_percentiles;
701e7e
 	uint32_t percentile_precision;
701e7e
-	uint32_t pad3;
701e7e
 	fio_fp64_t percentile_list[FIO_IO_U_LIST_MAX_LEN];
701e7e
 
701e7e
 	uint8_t read_iolog_file[FIO_TOP_STR_MAX];
701e7e
-- 
701e7e
2.17.0
701e7e