From 4d057f1f43868457dc265f0d2f93a30a0bd08a35 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Thu, 28 Jan 2016 12:47:11 -0700 Subject: [PATCH] client: fix double removal of client on job file open failure If fio is invoked as a client and the job file does not exist, it will exit ala: fio: job file open: No such file or directory fio: client.c:240: remove_client: Assertion `client->refs' failed. because the break path ends up doing the removal twice. Fix that to only remove it once, so we don't trigger the assert. Signed-off-by: Jens Axboe --- client.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/client.c b/client.c index 515cbf2e..6bc11454 100644 --- a/client.c +++ b/client.c @@ -816,6 +816,8 @@ int fio_clients_send_ini(const char *filename) struct flist_head *entry, *tmp; flist_for_each_safe(entry, tmp, &client_list) { + bool failed = false; + client = flist_entry(entry, struct fio_client, list); if (client->nr_files) { @@ -827,12 +829,13 @@ int fio_clients_send_ini(const char *filename) cf = &client->files[i]; if (fio_client_send_cf(client, cf)) { + failed = true; remove_client(client); break; } } } - if (client->sent_job) + if (client->sent_job || failed) continue; if (!filename || fio_client_send_ini(client, filename, 0)) remove_client(client); -- 2.25.1