Skip to content

Commit

Permalink
Revert "correctly free thread_data options at the topmost parent proc…
Browse files Browse the repository at this point in the history
…ess"

This reverts commit 913028e.

This commit is causing the static analyzers to freak out, and also
crashes on Windows. Revert it for now.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
axboe committed Jul 28, 2023
1 parent 696abd9 commit 824912b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 4 additions & 0 deletions backend.c
Original file line number Diff line number Diff line change
Expand Up @@ -2494,7 +2494,10 @@ static void run_threads(struct sk_out *sk_out)
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;
Expand All @@ -2503,6 +2506,7 @@ static void run_threads(struct sk_out *sk_out)
_exit(ret);
} else if (__td_index == fio_debug_jobno)
*fio_debug_jobp = pid;
free(eo);
free(fd);
fd = NULL;
}
Expand Down
3 changes: 1 addition & 2 deletions ioengines.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,7 @@ void free_ioengine(struct thread_data *td)
if (td->eo && td->io_ops->options) {
options_free(td->io_ops->options, td->eo);
free(td->eo);
if (td->o.use_thread)
td->eo = NULL;
td->eo = NULL;
}

if (td->io_ops->dlhandle) {
Expand Down
4 changes: 2 additions & 2 deletions options.c
Original file line number Diff line number Diff line change
Expand Up @@ -5829,9 +5829,9 @@ void fio_options_free(struct thread_data *td)
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)
Expand Down

0 comments on commit 824912b

Please sign in to comment.