From 4f591e873c0a38b662910f8e8a5768fd3e9bbeaa Mon Sep 17 00:00:00 2001 From: Raghavendra G Date: Wed, 30 May 2018 09:34:44 +0530 Subject: protocol/client: Don't send fops till SETVOLUME is complete An earlier commit set conf->connected just after rpc layer sends RPC_CLNT_CONNECT event. However, success of socket level connection connection doesn't indicate brick stack is ready to receive fops, as an handshake has to be done b/w client and server after RPC_CLNT_CONNECT event. Any fop sent to brick in the window between, * protocol/client receiving RPC_CLNT_CONNECT event * protocol/client receiving a successful setvolume response can end up accessing an uninitialized brick stack. So, set conf->connected only after a successful SETVOLUME. Change-Id: I139a03d2da6b0d95a0d68391fcf54b00e749decf fixes: bz#1584633 Signed-off-by: Raghavendra G (cherry picked from commit 430e4872db43447c8a15b638760d23c188257139) --- xlators/protocol/client/src/client.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'xlators/protocol/client/src/client.h') diff --git a/xlators/protocol/client/src/client.h b/xlators/protocol/client/src/client.h index c3c8aaec0d..5ee480367c 100644 --- a/xlators/protocol/client/src/client.h +++ b/xlators/protocol/client/src/client.h @@ -235,6 +235,11 @@ typedef struct clnt_conf { gf_boolean_t child_up; /* Set to true, when child is up, and * false, when child is down */ + + gf_boolean_t can_log_disconnect; /* socket level connection is + * up, disconnects can be + * logged + */ } clnt_conf_t; typedef struct _client_fd_ctx { -- cgit