mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jon Masters <jonmasters@gmail.com>
To: "linux-os (Dick Johnson)" <linux-os@analogic.com>
Cc: vinay hegde <thisismevinay@yahoo.co.in>,
	Linux kernel <linux-kernel@vger.kernel.org>
Subject: Re: Regarding - unresolved symbol
Date: Tue, 11 Oct 2005 16:32:22 +0100	[thread overview]
Message-ID: <35fb2e590510110832m39ef179eob07fb47f6f22c72f@mail.gmail.com> (raw)
In-Reply-To: <Pine.LNX.4.61.0510111104390.32115@chaos.analogic.com>

On 10/11/05, linux-os (Dick Johnson) <linux-os@analogic.com> wrote:

> On Tue, 11 Oct 2005, vinay hegde wrote:

> > [I am able to fix this problem by simply using the
> > 'sys_mknod()' call in my module, but I really would
> > like to know why the above piece of code can not
> > work!]

> Even sys_mknod() should not work from a module; Who's
> context did you steal to create that device-file? What
> happens next to that poor sucker? Who's data-space
> did you corrupt for the file-name string? I note that,
> from the names, it's likely that you intend to do this
> dastardly deed from a timer-queue!!!

Yummy.

> File operations require a process context. The kernel doesn't
> have one. All file operations should (read must) be done
> from user space. The kernel is designed to do things
> on behalf of user-space callers. Executing sys_* from
> a module will result in somebody saying; "See, you are
> wrong... It works fine!". Later on mysterious errors
> occur which are un-trackable.

The fix is to call out to userland to get the device node cerated for
you - either allow udev/devfs to do this for you, use
call_usermode_helper to do it, send a message up to userland via
NETLINK or whatever. There's more than one way to do it.

Jon.

  reply	other threads:[~2005-10-11 15:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-11 13:59 vinay hegde
2005-10-11 15:16 ` linux-os (Dick Johnson)
2005-10-11 15:32   ` Jon Masters [this message]
2005-10-11 15:21 ` Jon Masters

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=35fb2e590510110832m39ef179eob07fb47f6f22c72f@mail.gmail.com \
    --to=jonmasters@gmail.com \
    --cc=jonathan@jonmasters.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-os@analogic.com \
    --cc=thisismevinay@yahoo.co.in \
    /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®