public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Woodhouse <dwmw2@infradead.org>
To: "Marty Leisner" <mleisner@eng.mc.xerox.com>
Cc: linux-kernel@vger.kernel.org, leisner@rochester.rr.com
Subject: Re: kernel threads and close method in a device driver
Date: Wed, 18 Apr 2001 00:32:48 +0100	[thread overview]
Message-ID: <12080.987550368@redhat.com> (raw)
In-Reply-To: <200104172104.RAA08013@mailhost.eng.mc.xerox.com>
In-Reply-To: <200104172104.RAA08013@mailhost.eng.mc.xerox.com>


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



  parent reply	other threads:[~2001-04-17 23:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-17 21:04 kernel threads and close method in a device driver Marty Leisner
2001-04-17 21:37 ` Alan Cox
2001-04-17 21:43 ` Andi Kleen
2001-04-17 23:32 ` David Woodhouse [this message]
  -- strict thread matches above, loose matches on Subject: below --
2001-04-20 18:54 Marty Leisner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=12080.987550368@redhat.com \
    --to=dwmw2@infradead.org \
    --cc=leisner@rochester.rr.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mleisner@eng.mc.xerox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox