From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hal Rosenstock Subject: Re: [PATCH 1/2] rsocket: Fix removing rsocket from service thread Date: Mon, 07 Jul 2014 06:08:28 -0400 Message-ID: <53BA719C.8000702@dev.mellanox.co.il> References: <1404425324-20201-1-git-send-email-sean.hefty@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1404425324-20201-1-git-send-email-sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> Sender: linux-rdma-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-rdma@vger.kernel.org On 7/3/2014 6:08 PM, sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org wrote: > From: Sean Hefty > > 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 Tested-by: Hal Rosenstock -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html