[ofa-general] [PATCH v2] ipiob: fix rtnl deadlock

Yosef Etigin yosefe at voltaire.com
Mon Aug 11 23:25:44 PDT 2008


I don't think it will work, because the lock is taken way before your
flag is set.
If the lock is taken (by rtnl that calls ipoib_stop) and the flag is
not set yet,
ipoib_mcast_join_task() will still try to take the lock, and we have a deadlock.

--Yossi

>        if (!ipoib_cm_admin_enabled(dev)) {
> -               rtnl_lock();
> +               int took_lock = 0;
> +               if (!test_bit(IPOIB_FLAG_STOPPING, &priv->flags)) {
> +                       rtnl_lock();
> +                       took_lock = 1;
> +               }
>                dev_set_mtu(dev, min(priv->mcast_mtu, priv->admin_mtu));
> -               rtnl_unlock();
> +               if (took_lock)
> +                       rtnl_unlock();
>        }



More information about the general mailing list