summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
e413c2c)
Ensure we properly parse the time, use check_str_time()
instead of atoi(). Propagate the timeout correctly to
new jobs.
Signed-off-by: Jens Axboe <axboe@fb.com>
static char **ini_file;
static int max_jobs = FIO_MAX_JOBS;
static int dump_cmdline;
static char **ini_file;
static int max_jobs = FIO_MAX_JOBS;
static int dump_cmdline;
+static long long def_timeout;
static int parse_only;
static struct thread_data def_thread;
static int parse_only;
static struct thread_data def_thread;
+static void set_cmd_options(struct thread_data *td)
+{
+ struct thread_options *o = &td->o;
+
+ if (!o->timeout)
+ o->timeout = def_timeout;
+}
+
/*
* Return a free job structure.
*/
/*
* Return a free job structure.
*/
{
struct thread_data *td;
{
struct thread_data *td;
+ if (global) {
+ set_cmd_options(&def_thread);
if (setup_thread_area()) {
log_err("error: failed to setup shm segment\n");
return NULL;
if (setup_thread_area()) {
log_err("error: failed to setup shm segment\n");
return NULL;
if (!parent || !parent->o.group_reporting)
stat_number++;
if (!parent || !parent->o.group_reporting)
stat_number++;
memset(&def_thread, 0, sizeof(def_thread));
fio_getaffinity(getpid(), &def_thread.o.cpumask);
memset(&def_thread, 0, sizeof(def_thread));
fio_getaffinity(getpid(), &def_thread.o.cpumask);
- def_thread.o.timeout = def_timeout;
def_thread.o.error_dump = 1;
def_thread.o.error_dump = 1;
/*
* fill default options
*/
/*
* fill default options
*/
smalloc_pool_size = atoi(optarg);
break;
case 't':
smalloc_pool_size = atoi(optarg);
break;
case 't':
- def_timeout = atoi(optarg);
+ if (check_str_time(optarg, &def_timeout, 1)) {
+ log_err("fio: failed parsing time %s\n", optarg);
+ do_exit++;
+ exit_val = 1;
+ }
break;
case 'l':
write_lat_log = 1;
break;
case 'l':
write_lat_log = 1;