summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2019-07-01 14:26:29 -0600
committerJens Axboe <axboe@kernel.dk>2019-07-01 14:26:29 -0600
commit308aa5d011158d5f7fa533a60199066dd1858e4c (patch)
tree3f412ce81d7b1d8790c6c8fd6a33ad2a5335f4d4
parentc7cc1c75b801c5fce5dcf165c9b42e5f101be735 (diff)
parent07a2919d7a86607d42f5fb69f1f0ba98097d4d98 (diff)
Merge branch 'optlenmax' of https://github.com/powernap/fio
* 'optlenmax' of https://github.com/powernap/fio: Increase maximum length of line in jobs file to 8192
-rw-r--r--fio.12
-rw-r--r--init.c6
-rw-r--r--parse.h2
3 files changed, 6 insertions, 4 deletions
diff --git a/fio.1 b/fio.1
index 84b80ee..156201a 100644
--- a/fio.1
+++ b/fio.1
@@ -201,6 +201,8 @@ argument, \fB\-\-cmdhelp\fR will detail the given \fIcommand\fR.
See the `examples/' directory for inspiration on how to write job files. Note
the copyright and license requirements currently apply to
`examples/' files.
+
+Note that the maximum length of a line in the job file is 8192 bytes.
.SH "JOB FILE PARAMETERS"
Some parameters take an option of a given type, such as an integer or a
string. Anywhere a numeric value is required, an arithmetic expression may be
diff --git a/init.c b/init.c
index f2ba1e2..c9f6198 100644
--- a/init.c
+++ b/init.c
@@ -1887,7 +1887,7 @@ static int __parse_jobs_ini(struct thread_data *td,
}
}
- string = malloc(4096);
+ string = malloc(OPT_LEN_MAX);
/*
* it's really 256 + small bit, 280 should suffice
@@ -1920,7 +1920,7 @@ static int __parse_jobs_ini(struct thread_data *td,
if (is_buf)
p = strsep(&file, "\n");
else
- p = fgets(string, 4096, f);
+ p = fgets(string, OPT_LEN_MAX, f);
if (!p)
break;
}
@@ -1989,7 +1989,7 @@ static int __parse_jobs_ini(struct thread_data *td,
if (is_buf)
p = strsep(&file, "\n");
else
- p = fgets(string, 4096, f);
+ p = fgets(string, OPT_LEN_MAX, f);
if (!p)
break;
dprint(FD_PARSE, "%s", p);
diff --git a/parse.h b/parse.h
index b47a02c..9b4e2f3 100644
--- a/parse.h
+++ b/parse.h
@@ -37,7 +37,7 @@ struct value_pair {
void *cb; /* sub-option callback */
};
-#define OPT_LEN_MAX 4096
+#define OPT_LEN_MAX 8192
#define PARSE_MAX_VP 24
/*