Re: [patch] Yenta module race condition

From: Linus Torvalds (torvalds@transmeta.com)
Date: Thu May 04 2000 - 10:39:23 EST


On Thu, 4 May 2000, Alan Cox wrote:

> > static void yenta_close(pci_socket_t *sock)
> > {
> > + kill_proc(sock->private[7], SIGTERM, 0);
> > + schedule();
> > if (sock->cb_irq)
>
> This isnt a reliable answer as the task may take time to die

No, the right solution (in my opinion) is to
 - link yenta.o and pci_socket.o into _one_ object file (somewhat like the
   other pcmcia object files are packaged together)
 - make the threads increment the module counters on entry, and
   decrement them on exit

No need to even try something like the above, it's a hack. So when
somebody wants to unload the combined yenta module, he'd do "killall
CardBus + rmmod" (ie simply do the thread kill from user space instead of
having a kernel solution for it - it's not as if the cardbus stuff
shouldbe timed out anyway so the forced remove is a good idea)

                Linus

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun May 07 2000 - 21:00:15 EST