On Wednesday 03 February 2010 23:35, Roland Dreier wrote: > > 2. In closing/deallocating xrc domains, it is not an error if > ib_dealloc_xrcd returns "busy". > > This simply means that there are other user processes still using that > xrc domain. > > The current process still needs to clean up its uobject. In > particular, the usecnt should > > not be re-incremented on the busy return. (If it gets re-incremented on > busy, no one can ever > > succeed in closing an xrc domain if more that one process is using it). > > I do agree we shouldn't reincrement the use count if the dealloc > fails -- in ib_uverbs_dealloc_xrcd we're in the path of closing a > context and so there's no real way to recover if the ib_dealloc_xrcd > fails.
Agreed. If we return an error when there is no i-node, then we should also return an error when an i-node exists (and restore the status-quo-ante by reincrementing the refcnt in this case). Although, this will leave things in a weird state (with an xrcd which cannot get deallocated). Like you, I don't really see other options here. > But I don't think the busy case is an issue -- we should return > without trying to dealloc if the xrcd is held by another process, since > the atomic_dec_and_test will return a non-zero value in that case I > think. You are correct -- I missed that in my review. > So the simplification in the patch below should be OK, right? Looks good! -Jack -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
