From a542d89ee592d08204ca6d4ba62d087aed1df0fc Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 10 Jul 2012 13:24:51 -0700 Subject: mds: fix race in connection accept; fix con replacement We solve two problems with this patch. The first is that the messenger will now reuse an existing session's Connection with a new connection, which means that we don't want to change session->connection when we are validating an authorizer. Instead, set (but do not change) it. We also want to avoid a race where: - mds recovers, replays Sessions with no con's - multiple connection attempts for the same session race in the msgr - both are authorized, but out of order - Session->connection gets set to the losing attempt's Connection* Instead, we take advantage of an accept event that is called only for accepted winners. Signed-off-by: Sage Weil fixup --- src/mds/MDS.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/mds/MDS.h') diff --git a/src/mds/MDS.h b/src/mds/MDS.h index 67a51028d9c..0d7383b2d04 100644 --- a/src/mds/MDS.h +++ b/src/mds/MDS.h @@ -315,6 +315,7 @@ class MDS : public Dispatcher { bool ms_verify_authorizer(Connection *con, int peer_type, int protocol, bufferlist& authorizer_data, bufferlist& authorizer_reply, bool& isvalid); + void ms_handle_accept(Connection *con); void ms_handle_connect(Connection *con); bool ms_handle_reset(Connection *con); void ms_handle_remote_reset(Connection *con); -- cgit v1.2.1