for non-threaded mode: since thread_data::eo is a pointer within shared
memory between the topmost fio parent process and its children let the
fio parent process set the pointer to NULL as just it frees its copy of
'eo' as memory previously allocated by means of 'malloc' meaning that
each child and the parent process itself must free it
for threaded mode we leave it as it has always been
also we do not need to check td->io_ops for being able to free td->eo in
fio_options_free()
Signed-off-by: Denis Pronin <dannftk@yandex.ru>
strerror(ret));
} else {
pid_t pid;
- void *eo;
dprint(FD_PROCESS, "will fork\n");
- eo = td->eo;
- read_barrier();
pid = fork();
if (!pid) {
int ret;
_exit(ret);
} else if (__td_index == fio_debug_jobno)
*fio_debug_jobp = pid;
- free(eo);
free(fd);
fd = NULL;
}
if (td->eo && td->io_ops->options) {
options_free(td->io_ops->options, td->eo);
free(td->eo);
- td->eo = NULL;
+ if (td->o.use_thread)
+ td->eo = NULL;
}
if (td->io_ops->dlhandle) {
options_free(fio_options, &td->o);
if (td->eo && td->io_ops && td->io_ops->options) {
options_free(td->io_ops->options, td->eo);
- free(td->eo);
- td->eo = NULL;
}
+ free(td->eo);
+ td->eo = NULL;
}
void fio_dump_options_free(struct thread_data *td)