mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Amol P Dharmadhikari <apdharmadhikari@usfca.edu>
To: Sumit Narayan <sumit_uconn@lycos.com>
Cc: fdavis@si.rr.com, linux-kernel@vger.kernel.org
Subject: Re: Write file in EXT2
Date: Wed, 7 May 2003 09:55:17 -0700	[thread overview]
Message-ID: <20030507165517.GA24547@keckclus.cs.usfca.edu> (raw)
In-Reply-To: <JLODCPDJJDNBCDAA@mailcity.com>

Hello,

> Hi,
> 
> Thanks for the details.
> 
> I wish to know which application access which file, when.. etc etc. I would like to create a log of that. I am unable to write this log to the file from within the kernel. I would not like to go to the user level programs. I am doing this from within the kernel, as I would like to know exactly when things are being done.

As Richard said in reply to your earlier email, when you are doing file
I/O, you need to store the file descriptor of the open file in some
process's fd table. If you "simply open" a file in the kernel, it is
meaningless. The kernel just executes on behalf of the currently running
process and does not have an execution context itself.

So the idea is to create a kernel thread, and open the log file in its
context. Also, you want to be sure that the filesystem on which the file
you are accessing is mounted when you call the sys_open function. Else
the first write to it might cause a panic. 

-- 
Amol P Dharmadhikari <apdharmadhikari@usfca.edu>

  reply	other threads:[~2003-05-07 16:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-06 14:52 Sumit Narayan
2003-05-07 16:55 ` Amol P Dharmadhikari [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-05-06 14:45 Sumit Narayan
2003-05-06 15:34 ` Richard B. Johnson
2003-05-06  3:14 Sumit Narayan
2003-05-06  4:10 ` Valdis.Kletnieks
2003-05-06  7:17 ` Matti Aarnio

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=20030507165517.GA24547@keckclus.cs.usfca.edu \
    --to=apdharmadhikari@usfca.edu \
    --cc=fdavis@si.rr.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sumit_uconn@lycos.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

all inboxes | Powered by JetHome®