Re: simple handling of module removals Re: [OKS] Module removal

Brian Gerst
2002-07-04T15:05:29Z

Keith Owens wrote:
> On Wed, 03 Jul 2002 22:25:34 -0400,
> Brian Gerst <bgerst@didntduck.org> wrote:
>
>>Why not treat a module just like any other structure? Obtain a
>>reference to it _before_ using it.
>
>
> That is what try_inc_use_count() does. But the interface is messy and
> difficult to audit. It relies on the caller taking some other lock
> first to ensure that the module address will not change while you are
> trying to call try_inc_use_count.

And that is almost always the case anyways, since most cases traverse a
linked list that must already be protected. You are trying to
overengineer a solution to a simple, but subtle, problem.

PS. If you really want to make the broken cases show themselves, poison
the module memory when it is unloaded. The same can be done for dumping
init data and text.

--
Brian Gerst