From: Greg Farnum Date: Mon, 18 Oct 2010 18:23:50 +0000 (-0700) Subject: messenger: Make sure to unlock existing->pipe_lock. X-Git-Tag: v0.22.1~25 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=781874f01fd96072bc99044679205c47895024b2;p=ceph.git messenger: Make sure to unlock existing->pipe_lock. There are a few cases in the "open" section where we can go to fail_unlocked while still holding existing->pipe_lock. So unlock it. --- diff --git a/src/msg/SimpleMessenger.cc b/src/msg/SimpleMessenger.cc index 463226777db..f826448d98d 100644 --- a/src/msg/SimpleMessenger.cc +++ b/src/msg/SimpleMessenger.cc @@ -842,13 +842,19 @@ int SimpleMessenger::Pipe::accept() messenger->lock.Unlock(); rc = tcp_write(sd, (char*)&reply, sizeof(reply)); - if (rc < 0) + if (rc < 0) { + if (existing) + existing->pipe_lock.Unlock(); goto fail_unlocked; + } if (reply.authorizer_len) { rc = tcp_write(sd, authorizer_reply.c_str(), authorizer_reply.length()); - if (rc < 0) + if (rc < 0) { + if (existing) + existing->pipe_lock.Unlock(); goto fail_unlocked; + } } if (replace) { @@ -856,10 +862,12 @@ int SimpleMessenger::Pipe::accept() if (reply_tag == CEPH_MSGR_TAG_SEQ) { if(tcp_write(sd, (char*)&existing->in_seq, sizeof(existing->in_seq)) < 0) { dout(2) << "accept write error on in_seq" << dendl; + existing->pipe_lock.Unlock(); goto fail_unlocked; } if(tcp_read(sd, (char*)&newly_acked_seq, sizeof(newly_acked_seq)) < 0) { dout(2) << "accept read error on newly_acked_seq" << dendl; + existing->pipe_lock.Unlock(); goto fail_unlocked; } }