]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: fix missing unlock; simplify
authorSage Weil <sage@inktank.com>
Sat, 1 Dec 2012 05:35:20 +0000 (21:35 -0800)
committerSage Weil <sage@inktank.com>
Sun, 2 Dec 2012 00:56:48 +0000 (16:56 -0800)
Instead of a special-case exit, just skip the con replacement.  Continue
on to mark the old con down.

CID 745920 (#1 of 1): Missing unlock (LOCK)
At (8): Returning without unlocking "this->heartbeat_lock._m".

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

index 7297548ebe78c3d4a5b22cf8e1b1043806ba3b70..58859a5741abc5b2d05acb8705b09e2a3f9a834d 100644 (file)
@@ -2082,13 +2082,12 @@ bool OSD::heartbeat_reset(Connection *con)
       ConnectionRef newcon = service.get_con_osd_hb(p->second.peer, p->second.epoch);
       if (!newcon) {
        dout(10) << "heartbeat_reset reopen failed hb con " << con << " but failed to reopen" << dendl;
-       s->put();
-       return true;
+      } else {
+       dout(10) << "heartbeat_reset reopen failed hb con " << con << dendl;
+       p->second.con = newcon.get();
+       p->second.con->get();
+       p->second.con->set_priv(s);
       }
-      dout(10) << "heartbeat_reset reopen failed hb con " << con << dendl;
-      p->second.con = newcon.get();
-      p->second.con->get();
-      p->second.con->set_priv(s);
     } else {
       dout(10) << "heartbeat_reset closing (old) failed hb con " << con << dendl;
     }