From: Jens Axboe Date: Tue, 13 Sep 2016 15:08:00 +0000 (-0600) Subject: client: ignore SEND_ETA, if we can't fin a reply command X-Git-Tag: fio-2.14~7 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=308d69b5d340577b7886696f39753b7ba5ae9e11 client: ignore SEND_ETA, if we can't fin a reply command This can happen if we time out a reply, but the the reply comes in a bit later. For that case, we already decremented the ETA count, so we should just ignore the late reply. Signed-off-by: Jens Axboe --- diff --git a/client.c b/client.c index 34566650..c8069a01 100644 --- a/client.c +++ b/client.c @@ -1183,7 +1183,7 @@ void fio_client_sum_jobs_eta(struct jobs_eta *dst, struct jobs_eta *je) strcpy((char *) dst->run_str, (char *) je->run_str); } -static void remove_reply_cmd(struct fio_client *client, struct fio_net_cmd *cmd) +static bool remove_reply_cmd(struct fio_client *client, struct fio_net_cmd *cmd) { struct fio_net_cmd_reply *reply = NULL; struct flist_head *entry; @@ -1199,12 +1199,13 @@ static void remove_reply_cmd(struct fio_client *client, struct fio_net_cmd *cmd) if (!reply) { log_err("fio: client: unable to find matching tag (%llx)\n", (unsigned long long) cmd->tag); - return; + return false; } flist_del(&reply->list); cmd->tag = reply->saved_tag; free(reply); + return true; } int fio_client_wait_for_reply(struct fio_client *client, uint64_t tag) @@ -1653,7 +1654,8 @@ int fio_handle_client(struct fio_client *client) case FIO_NET_CMD_ETA: { struct jobs_eta *je = (struct jobs_eta *) cmd->payload; - remove_reply_cmd(client, cmd); + if (!remove_reply_cmd(client, cmd)) + break; convert_jobs_eta(je); handle_eta(client, cmd); break;