]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
msg/async/rdma: Update fix broken compilation 13940/head
authorSarit Zubakov <saritz@mellanox.com>
Thu, 9 Mar 2017 13:32:43 +0000 (13:32 +0000)
committerAdir Lev <adirl@mellanox.com>
Mon, 13 Mar 2017 11:56:08 +0000 (13:56 +0200)
This commit relates to fix broken compilation commit# b8f91aa
Assumption: If "out" is NULL then there is no communication and it is
safe to assert.

issue:985021

Change-Id: I76c5a1c875a634a74b8aa962294c6c834f0675d9
Signed-off-by: Sarit Zubakov <saritz@mellanox.com>
src/msg/async/rdma/RDMAServerSocketImpl.cc

index f15de84bec4bc49c063e077e4235cd7ff563b265..8f5fd81d3dc751eab08adf86f2a031979c1c3dd3 100644 (file)
@@ -96,6 +96,10 @@ int RDMAServerSocketImpl::accept(ConnectedSocket *sock, const SocketOptions &opt
     ::close(sd);
     return -errno;
   }
+
+  assert(NULL != out); //out should not be NULL in accept connection
+
+  out->set_sockaddr((sockaddr*)&ss);
   net.set_priority(sd, opt.priority, out->get_family());
 
   RDMAConnectedSocketImpl* server;
@@ -105,8 +109,6 @@ int RDMAServerSocketImpl::accept(ConnectedSocket *sock, const SocketOptions &opt
   ldout(cct, 20) << __func__ << " accepted a new QP, tcp_fd: " << sd << dendl;
   std::unique_ptr<RDMAConnectedSocketImpl> csi(server);
   *sock = ConnectedSocket(std::move(csi));
-  if (out)
-    out->set_sockaddr((sockaddr*)&ss);
 
   return 0;
 }