lkml.org 
[lkml]   [2001]   [Apr]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: kernel threads and close method in a device driver
Date

mleisner@eng.mc.xerox.com said:
> The architecture is currently:
> open device
> do IOCTL (spinning a kernel thread and doing initialization)
> There is currently an IOCTL which short-circuits to the close method.
> Turns out it seems necessary to do this IOCTL -- close never gets
> invoked.

Your kernel thread is probably sharing filedescriptors with the parent
process, so although your application closes its copy, because the kernel
thread hasn't closed its copy, the ->release() method never gets called.

Make sure you're cleaning up properly when starting the kernel thread. See
how other kernel threads do it. As Andi says, daemonize() is a good start,
although it's not always sufficient.

--
dwmw2


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

\
 
 \ /
  Last update: 2005-03-22 13:26    [from the cache]
©2003-2011 Jasper Spaans