]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
msg/Pipe: unlock msgr->lock earlier in accept()
authorSage Weil <sage@inktank.com>
Tue, 16 Jul 2013 20:01:18 +0000 (13:01 -0700)
committerSage Weil <sage@inktank.com>
Wed, 17 Jul 2013 21:34:40 +0000 (14:34 -0700)
Small cleanup.  Nothing needs msgr->lock for the previously larger
window.

Signed-off-by: Sage Weil <sage@inktank.com>
src/msg/Pipe.cc

index 571c3fa3233df985b37511217b2c6ec0eb7390dd..5c10e1b8cd53479e0b1edec870acb9ebd03b1b2b 100644 (file)
@@ -340,13 +340,13 @@ int Pipe::accept()
 
     memset(&reply, 0, sizeof(reply));
     reply.protocol_version = msgr->get_proto_version(peer_type, false);
+    msgr->lock.Unlock();
 
     // mismatch?
     ldout(msgr->cct,10) << "accept my proto " << reply.protocol_version
             << ", their proto " << connect.protocol_version << dendl;
     if (connect.protocol_version != reply.protocol_version) {
       reply.tag = CEPH_MSGR_TAG_BADPROTOVER;
-      msgr->lock.Unlock();
       goto reply;
     }
 
@@ -372,12 +372,9 @@ int Pipe::accept()
     if (feat_missing) {
       ldout(msgr->cct,1) << "peer missing required features " << std::hex << feat_missing << std::dec << dendl;
       reply.tag = CEPH_MSGR_TAG_FEATURES;
-      msgr->lock.Unlock();
       goto reply;
     }
     
-    msgr->lock.Unlock();
-
     // Check the authorizer.  If not good, bail out.
 
     if (!msgr->verify_authorizer(connection_state.get(), peer_type, connect.authorizer_protocol, authorizer,