Quoting r. Roland Dreier <[EMAIL PROTECTED]>:
> Subject: Re: user_mad.c: deadlock?
> 
>     Michael> I'm not convinced.  What would prevent ib_umad_close from
>     Michael> touching the list if we release the mutex?
> 
> Good point, ib_umad_close() could race against device removal.  But we
> had that problem before: ib_umad_close() doesn't hold the mutex while
> going through the agent list.
> 
>  - R.
> 

To fix ib_umad_kill_port properly, lets clean out port->file_list under the
mutex. Something using list_del_init, like

struct list_head *list;
for (;;) {
        down_write(&port->mutex);
        if (!list_empty(&port->file_list))
                break;
        list=port->file_list->next;
        list_del_init(list);
        up_write(&port->mutex);
        file = list_entry(file, list, port_list);

        /* ... Deregister .... */
        down_write(&port->mutex);
}

Makes sense?

-- 
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