In case of removing ib_ipoib module ipoib_ib_dev_stop() function will be
called and all address handles (ah) in dead_ahs list will be reaped.
But some ah will be added to the dead list after ipoib_ib_dev_stop done
by ipoib_mcast_free. These ahs will not be freed.

The solution here is to wait till multicast_list will be empty. So, all
ahs will be added to dead_ahs list.

Signed-off-by: Vladimir Sokolovsky <[EMAIL PROTECTED]>
---
Roland,
There may be some extremely slight window for leaking address handles
still, since the multicast list is emptied in ipoib_mcast_dev_flush() before
it calls ipoib_mcast_free() (which adds address handles to the dead list).

However, this seems to be the best compromise that I can see without
a lot of nasty (and possibly buggy) changes.

 drivers/infiniband/ulp/ipoib/ipoib_ib.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/infiniband/ulp/ipoib/ipoib_ib.c 
b/drivers/infiniband/ulp/ipoib/ipoib_ib.c
index 66cafa2..6cc0c59 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_ib.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_ib.c
@@ -863,7 +863,7 @@ timeout:
 
        begin = jiffies;
 
-       while (!list_empty(&priv->dead_ahs)) {
+       while (!list_empty(&priv->dead_ahs) || 
!list_empty(&priv->multicast_list)) {
                __ipoib_reap_ah(dev);
 
                if (time_after(jiffies, begin + HZ)) {
-- 
1.5.6.3

_______________________________________________
general mailing list
[email protected]
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general

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

Reply via email to