]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
xio: check if connection is on list before erasing
authorCasey Bodley <casey@cohortfs.com>
Tue, 14 Apr 2015 20:36:05 +0000 (16:36 -0400)
committerVu Pham <vu@mellanox.com>
Thu, 21 May 2015 13:59:46 +0000 (06:59 -0700)
also removed the extra conditional put() in on_disconnect_event()

Signed-off-by: Casey Bodley <casey@cohortfs.com>
src/msg/xio/XioConnection.h
src/msg/xio/XioMessenger.cc

index 6ab116dd306ec683f75a0665f5331208be4f06ba..9a5f615893a554dc8b95cc826b3860263431cd83 100644 (file)
@@ -228,8 +228,6 @@ private:
     connected.set(false);
     pthread_spin_lock(&sp);
     discard_input_queue(CState::OP_FLAG_LOCKED);
-    if (!conn)
-      this->put();
     pthread_spin_unlock(&sp);
     return 0;
   }
index 198fb00c4ad1b1a8e00fdae214be090e5f9d7334..3cfe34aee9da568464310f43f594c50794ddac47 100644 (file)
@@ -529,11 +529,13 @@ int XioMessenger::session_event(struct xio_session *session,
          conns_entity_map.erase(conn_iter);
        }
       }
-      /* now find xcon on conns_list, erase, and release sentinel ref */
-      XioConnection::ConnList::iterator citer =
-       XioConnection::ConnList::s_iterator_to(*xcon);
-      /* XXX check if citer on conn_list? */
-      conns_list.erase(citer);
+      /* check if citer on conn_list */
+      if (xcon->conns_hook.is_linked()) {
+        /* now find xcon on conns_list and erase */
+        XioConnection::ConnList::iterator citer =
+            XioConnection::ConnList::s_iterator_to(*xcon);
+        conns_list.erase(citer);
+      }
       xcon->on_disconnect_event();
     }
     break;