[openib-general] Re: [PATCH] cm refcount race fix

Roland Dreier rdreier at cisco.com
Mon May 8 09:39:55 PDT 2006


    Michael> cm_deref_id does nothing outside the lock.

But you could still have:

/* Make sure cm_deref_id is not in progress */
spin_lock_irq(&cm_id_priv->lock);
spin_unlock_irq(&cm_id_priv->lock);

				spin_lock_irqsave(&cm_id_priv->lock, flags);
				if (atomic_dec_and_test(&cm_id_priv->refcount))

wait_event(cm_id_priv->wait, !atomic_read(&cm_id_priv->refcount));

while ((work = cm_dequeue_work(cm_id_priv)) != NULL)
	cm_free_work(work);
kfree(cm_id_priv->compare_data);

			 		wake_up(&cm_id_priv->wait);
				spin_unlock_irqrestore(&cm_id_priv->lock, flags);

 - R.



More information about the general mailing list