All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: sparclinux@vger.kernel.org
Subject: Re: Linux on Sun e10k
Date: Sun, 28 Jan 2007 02:38:16 +0000	[thread overview]
Message-ID: <20070127.183816.88477865.davem@davemloft.net> (raw)
In-Reply-To: <1169241607.30406.19.camel@duo.jes.ee>

From: Jan Engelhardt <jengelh@linux01.gwdg.de>
Date: Sat, 27 Jan 2007 12:17:53 +0100 (MET)

> 
> >Looking at init/main.c:
> >
> >if (sys_open((const char __user *) "/dev/console", O_RDWR, 0) < 0)
> >   printk(KERN_WARNING "Warning: unable to open an initial console.\n");
> 
> That looks almost like a bug :-/
> "/dev/console" will decay into a pointer to kernel space, but
> sys_open takes a userspace one. The __user annotation does not
> change that. Try adding this:
> 
> >... so, if root is mounted (over nfs), and root is mounted rw,
> >and /dev/console exists on the nfsroot, and it has rw permissions (I
> >gave it chmod 777 to just be sure), why would that sys_open call fail
> >and trigger that printk?
> 
> int ret = sys_open((const char __user *)"/dev/console", O_RDWR, 0);
> if(ret < 0)
>   printk(KERN_WARNING "Warning: unable to open an "
>          "initial console (%d)\n", ret);
> 
> I wonder what return code it will give (-EFAULT is my guess).

It's not getting -EFAULT, the init task runs with set_fs(KERNEL_DS).

It's getting -ENOENT because no console device has registered
itself, and therefore even if you have a /dev/console node in
the filesystem the open will still fail.

  parent reply	other threads:[~2007-01-28  2:38 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-19 21:20 Linux on Sun e10k Tõnu Samuel
2007-01-21 15:25 ` Meelis Roos
2007-01-26 22:05 ` Tom 'spot' Callaway
2007-01-26 22:15 ` Tom 'spot' Callaway
2007-01-26 23:12 ` Jan Engelhardt
2007-01-26 23:17 ` Tom 'spot' Callaway
2007-01-27  0:39 ` Tom 'spot' Callaway
2007-01-27  2:10 ` David Miller
2007-01-27  3:42 ` Tom 'spot' Callaway
2007-01-27  4:28 ` Tom 'spot' Callaway
2007-01-27 10:19 ` Tõnu Samuel
2007-01-27 11:17 ` Jan Engelhardt
2007-01-27 15:37 ` Tom 'spot' Callaway
2007-01-27 16:05 ` Jan Engelhardt
2007-01-27 16:31 ` Tom 'spot' Callaway
2007-01-27 16:53 ` Jan Engelhardt
2007-01-28  2:38 ` David Miller [this message]
2007-01-28 12:26 ` Jan Engelhardt
2007-01-29 15:08 ` Meelis Roos
2007-01-29 16:39 ` David Miller
2007-01-29 16:52 ` Tom 'spot' Callaway
2007-01-29 17:34 ` David Miller
2007-01-29 19:45 ` Tom 'spot' Callaway
2007-01-29 20:07 ` David Miller
2007-02-21 16:01 ` Peter Jones
2007-02-22 11:09 ` David Miller

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=20070127.183816.88477865.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=sparclinux@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.