client: take better care to return failure from fio_handle_clients()
If any error has been noted in the ->error field, we need to pass
back a non-zero return from fio_handle_clients().
Signed-off-by: Jens Axboe <axboe@fb.com>
diff --git a/client.c b/client.c
index 74c9c76..760ec85 100644
--- a/client.c
+++ b/client.c
@@ -62,6 +62,8 @@
static struct json_array *clients_array = NULL;
static struct json_array *du_array = NULL;
+static int error_clients;
+
#define FIO_CLIENT_HASH_BITS 7
#define FIO_CLIENT_HASH_SZ (1 << FIO_CLIENT_HASH_BITS)
#define FIO_CLIENT_HASH_MASK (FIO_CLIENT_HASH_SZ - 1)
@@ -176,6 +178,9 @@
if (!client->did_stat)
sum_stat_clients--;
+ if (client->error)
+ error_clients++;
+
free(client);
}
@@ -1616,6 +1621,7 @@
else
log_err("fio: client %s timed out\n", client->hostname);
+ client->error = ETIMEDOUT;
remove_client(client);
ret = 1;
}
@@ -1709,5 +1715,5 @@
fio_client_json_fini();
free(pfds);
- return retval;
+ return retval || error_clients;
}