[openib-general] Re: user_mad.c: deadlock?

Michael S. Tsirkin mst at mellanox.co.il
Wed Nov 9 11:02:46 PST 2005


Quoting r. Roland Dreier <rolandd at cisco.com>:
> Subject: Re: user_mad.c: deadlock?
> 
>     Michael> Makes sense?
> 
> No, I think you have to make a copy of the full list of agents and
> clean out the file's list while holding the mutex.  Otherwise
> ib_umad_close() could run while ib_umad_kill_port() is dealing with
> the same file.

And that should be fine since its safe to call list_del after list_del_init.

> And also we need ib_umad_kill_port() to wait for any
> in-progress ib_umad_close() calls, since we don't want to call
> ib_unregister_mad_agent() after we've returned from the device removal
> call.

This should work fine too since the last down_write that  detects
that list list is empty will flush these guys out.

> The locking is a little tricky, I'll work something out.

OK, if you dont manage to, I'll look into it tomorrow.

-- 
MST



More information about the general mailing list