From 58c7dd98d2c2c36f26a6d11508b1c47e9bf41628 Mon Sep 17 00:00:00 2001 From: Christian Hopps Date: Sun, 11 Jun 2023 22:13:48 -0400 Subject: [PATCH] lib: mgmtd: session create and destroy both short-circuit For creation this is the first thing done so short-circuit just means inline sync response. However, for destroy there could be commands in-flight, these will be discarded when they match no session, and the state cleaned up immediately when the message short-circuits. Signed-off-by: Christian Hopps (cherry picked from commit 0fc08fa7381fdba03a0c2e5b745929954172915a) --- lib/mgmt_fe_client.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/mgmt_fe_client.c b/lib/mgmt_fe_client.c index 35a6d7d909..7af421405b 100644 --- a/lib/mgmt_fe_client.c +++ b/lib/mgmt_fe_client.c @@ -124,18 +124,15 @@ static int mgmt_fe_send_session_req(struct mgmt_fe_client *client, { Mgmtd__FeMessage fe_msg; Mgmtd__FeSessionReq sess_req; - bool scok; mgmtd__fe_session_req__init(&sess_req); sess_req.create = create; if (create) { sess_req.id_case = MGMTD__FE_SESSION_REQ__ID_CLIENT_CONN_ID; sess_req.client_conn_id = session->client_id; - scok = true; } else { sess_req.id_case = MGMTD__FE_SESSION_REQ__ID_SESSION_ID; sess_req.session_id = session->session_id; - scok = false; } mgmtd__fe_message__init(&fe_msg); @@ -146,7 +143,7 @@ static int mgmt_fe_send_session_req(struct mgmt_fe_client *client, "Sending SESSION_REQ %s message for client-id %" PRIu64, create ? "create" : "destroy", session->client_id); - return mgmt_fe_client_send_msg(client, &fe_msg, scok); + return mgmt_fe_client_send_msg(client, &fe_msg, true); } int mgmt_fe_send_lockds_req(struct mgmt_fe_client *client, uint64_t session_id, -- 2.39.5