]> git.openfabrics.org - ~shefty/librdmacm.git/commit
rsocket: Fix removing rsocket from service thread
authorSean Hefty <sean.hefty@intel.com>
Thu, 3 Jul 2014 20:55:39 +0000 (13:55 -0700)
committerSean Hefty <sean.hefty@intel.com>
Thu, 3 Jul 2014 20:55:39 +0000 (13:55 -0700)
commit1695abfa9f6bf429a5aa07117310c4ad87d4b3ae
tree1a5cb7d49165b81416f17f7618b0665f4a23b7c9
parent9085562c22189850e1f16b9a9955f11e79caac06
rsocket: Fix removing rsocket from service thread

When removing an rsocket from a service thread, we replace
the removed service with the one at the end of the service list.
This keeps the array tightly packed.  However, rs_svc_rm_rs
decrements the rsocket count before doing the swap.  The result
is that the entry at the end of the list gets dropped off.
Defer decrementing the count until the swap has been made.

In this case, the cnt value is a valid index into the array,
because we start at index 1.  Index 0 is used internally by
the service thread.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
src/rsocket.c