Hello, Roland!
Here's a simple race scenario.

device is up.
port event triggers flush_task.
ipoib_ib_dev_flush (running from the default work queue)
calls ipoib_ib_dev_down.
This calls ipoib_mcast_stop_thread.
This flushes the ipoib workqueue.
mcast_task runs on ipoib workqueue, since IPOIB_FLAG_ADMIN_UP is set,
this re-starts the mcast task.

As a result mcast_task may be running while mcast_stop_thread
is scanning the multicast_list, or after that.

---

Fix race condition where mcast_task may be running after
ipoib_mcast_stop_thread has flushed the workqueue.

Signed-off-by: Michael S. Tsirkin <[EMAIL PROTECTED]>

Index: linux-2.6.14/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
===================================================================
--- linux-2.6.14/drivers/infiniband/ulp/ipoib/ipoib_multicast.c (revision 4042)
+++ linux-2.6.14/drivers/infiniband/ulp/ipoib/ipoib_multicast.c (working copy)
@@ -904,7 +904,7 @@
                ipoib_mcast_free(mcast);
        }
 
-       if (test_bit(IPOIB_FLAG_ADMIN_UP, &priv->flags))
+       if (test_bit(IPOIB_FLAG_OPER_UP, &priv->flags))
                ipoib_mcast_start_thread(dev);
 }
 

-- 
MST
_______________________________________________
openib-general mailing list
[email protected]
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to