Re: PATCH: (as177) Add class_device_unregister_wait() andplatform_device_unregister_wait() to the driver model core

From: Rusty Russell
Date: Mon Jan 26 2004 - 01:11:54 EST


On Fri, 23 Jan 2004 10:11:06 -0800
Greg KH <greg@xxxxxxxxx> wrote:

> On Fri, Jan 23, 2004 at 09:42:09AM -0800, Linus Torvalds wrote:
> >
> >
> > On Fri, 23 Jan 2004, Alan Stern wrote:
> > >
> > > Since I haven't seen any progress towards implementing the
> > > class_device_unregister_wait() and platform_device_unregister_wait()
> > > functions, here is my attempt.
> >
> > So why would this not deadlock?
>
> It will deadlock if the user does something braindead like:
> rmmod foo < /sys/class/foo_class/foo1/file

Um, if module foo exports a class, then why doesn't opening the class file
bump the owner count so the above will fail?

If you want to safely remove parts of the kernel, you have to maintain
reference counts. At least with any sane scheme I've seen.

I know, I should go read the code...
Rusty.
--
there are those who do and those who hang on and you don't see too
many doers quoting their contemporaries. -- Larry McVoy
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/