[openib-general] [PATCH] for 2-6-19 rdma/addr: use client registration to fix module unload race
Michael S. Tsirkin
mst at mellanox.co.il
Tue Oct 31 03:50:17 PST 2006
Quoting r. Or Gerlitz <ogerlitz at voltaire.com>:
> Subject: Re: [openib-general] [PATCH] for 2-6-19 rdma/addr: use client registration to fix module unload race
>
> Michael S. Tsirkin wrote:
> > Quoting r. Or Gerlitz <ogerlitz at voltaire.com>:
> >>>> Require registration with ib_addr module to prevent caller from unloading
> >>>> while a callback is in progress.
> >>> ib_cm has this bug as well. Shouldn't we patch it for 2.6.19 too?
> >> I know there was a similar discussion which i was not tracking... re
> >> registrations with the ib_sa module, however, please tell me if and why
> >> i am wrong:
> >
> > Look it up in the archives. Summary:
> >
> > The race happens on module unload - you might be inside the cm callback when
> > the module is unloaded. Nothing the module itself does can help here - you must
> > synchronize with the cm before unloading.
>
> I think to understand: you say that the CM can call the callback while
> the module unloads. However, my point is that the cm consumer module
> must destroy its cm id before unloading and that the cm id destroy code
> would block till all inflight callbacks on this id are done. Similarly
> to destroy_timer_sync or whatever it is called.
>
> Am i still missing something?
Yes, you miss the case where you do not destroy cm id explicitly, but rather
return error code from callback instead of destroying the cm_id.
--
MST
More information about the general
mailing list