]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
xio: Fix release xio message on closed connection issue
authorVu Pham <vu@mellanox.com>
Mon, 2 Feb 2015 10:49:34 +0000 (02:49 -0800)
committerVu Pham <vu@mellanox.com>
Thu, 5 Feb 2015 09:56:53 +0000 (01:56 -0800)
Do not call xio_release_msg on closed connection

Signed-off-by: Vu Pham <vu@mellanox.com>
src/msg/xio/XioPortal.h

index cd7a2e7025803a36876614175f185e702ca2cb8f..fdc197230b93eeac2f92a1f3c0d6edcd9d5e4b6c 100644 (file)
@@ -158,9 +158,13 @@ public:
   inline void release_xio_rsp(XioRsp* xrsp) {
     struct xio_msg *msg = xrsp->dequeue();
     struct xio_msg *next_msg = NULL;
+    int code;
     while (msg) {
       next_msg = static_cast<struct xio_msg *>(msg->user_context);
-      int code = xio_release_msg(msg);
+      if (unlikely(!xrsp->xcon->conn || !xrsp->xcon->is_connected()))
+        code = ENOTCONN;
+      else
+        code = xio_release_msg(msg);
       if (unlikely(code)) {
        /* very unlikely, so log it */
        xrsp->xcon->msg_release_fail(msg, code);