]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
msgr: fix bad unlock on tcp_write error
authorSage Weil <sage@newdream.net>
Mon, 23 Nov 2009 22:23:13 +0000 (14:23 -0800)
committerSage Weil <sage@newdream.net>
Mon, 23 Nov 2009 22:23:13 +0000 (14:23 -0800)
src/msg/SimpleMessenger.cc

index 6eda255824b386f3529f3bda8b0876dee97a5c23..7e9eb341096607c3870f2ecd99e8a4e15df0abe3 100644 (file)
@@ -814,12 +814,12 @@ int SimpleMessenger::Pipe::accept()
 
   rc = tcp_write(sd, (char*)&reply, sizeof(reply));
   if (rc < 0)
-    goto fail;
+    goto fail_unlocked;
 
   if (reply.authorizer_len) {
     rc = tcp_write(sd, authorizer_reply.c_str(), authorizer_reply.length());
     if (rc < 0)
-      goto fail;
+      goto fail_unlocked;
   }
 
   lock.Lock();
@@ -832,8 +832,6 @@ int SimpleMessenger::Pipe::accept()
   return 0;   // success.
 
 
- fail:
-  rank->lock.Unlock();
  fail_unlocked:
   lock.Lock();
   state = STATE_CLOSED;