From: Raj <inguva@gmail.com>
To: Jan Engelhardt <jengelh@linux01.gwdg.de>
Cc: Arne Henrichsen <ahenric@gmail.com>, linux-kernel@vger.kernel.org
Subject: Re: Problems with close() system call
Date: Wed, 27 Oct 2004 10:18:10 +0530 [thread overview]
Message-ID: <b2fa632f0410262148411ad85a@mail.gmail.com> (raw)
In-Reply-To: <Pine.LNX.4.53.0410261739470.641@yvahk01.tjqt.qr>
On Tue, 26 Oct 2004 17:43:36 +0200 (MEST), Jan Engelhardt
<jengelh@linux01.gwdg.de> wrote:
> >> Best is to put a printk("i'm in ioctl()") in the ioctl() function and a
> >> printk("i'm in close()") in the close() one, to be really sure whether the
> >> close() function of your module is called.
> >
> >Yes, that is exactly what I am doing. I basically implement the
> >flush() call (for close) as the release() call was never called on
> >close. So my release call does nothing. What I see is that the flush
>
> Uh, then something's wrong. Your device fops should look like this:
> {
> .release = my_close, // which is called upon close(2)
> }
>
> Anything else is of course, never working.
iirc, once i faced this problem. I compiled a sample device driver
against kernel version
'X'. and tried to insmod the binary into kernel version 'Y' which had
it's fop's struct
modified. The structure offsets took a beating and all hell broke
loose. Calling open()
called something else etc.... Ever since, i started using the above notation to
initialize struct members. Hard learned lesson ;-)
--
######
raj
######
prev parent reply other threads:[~2004-10-27 4:48 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-10-25 11:40 Problems with close() system call Arne Henrichsen
2004-10-26 11:30 ` Jan Engelhardt
2004-10-26 12:43 ` Arne Henrichsen
2004-10-26 15:43 ` Jan Engelhardt
2004-10-27 4:48 ` Raj [this message]
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=b2fa632f0410262148411ad85a@mail.gmail.com \
--to=inguva@gmail.com \
--cc=ahenric@gmail.com \
--cc=jengelh@linux01.gwdg.de \
--cc=linux-kernel@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).