Revert "correctly free thread_data options at the topmost parent process"
authorJens Axboe <axboe@kernel.dk>
Fri, 28 Jul 2023 17:32:22 +0000 (11:32 -0600)
committerJens Axboe <axboe@kernel.dk>
Fri, 28 Jul 2023 17:32:22 +0000 (11:32 -0600)
This reverts commit 913028e97ceedcf2cf1ec6ec32228b3c50e7337c.

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>
backend.c
ioengines.c
options.c

index b21c36640e4c5efb096a5633c849820e49444592..5f0740395bad36cd9d13c30bf6bb9d871805c785 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -2494,7 +2494,10 @@ reap:
                                                        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;
@@ -2503,6 +2506,7 @@ reap:
                                        _exit(ret);
                                } else if (__td_index == fio_debug_jobno)
                                        *fio_debug_jobp = pid;
+                               free(eo);
                                free(fd);
                                fd = NULL;
                        }
index fd8c9d1a65742543a2ea054eebc0007fd5099343..361727250eb70ff0932e899d8f31e98ddeaecba6 100644 (file)
@@ -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) {
index 9432a0fbdfaa94891fe9dc4af01ca611c57c7227..48aa0d7b1ccaf2d7a8041a2b383bafdf31ca7a5f 100644 (file)
--- a/options.c
+++ b/options.c
@@ -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)