All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Serge E. Hallyn" <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
To: sukadev-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org
Cc: kyle-hoO6YkzgTuCM0SS3m2neIg@public.gmane.org,
	"David C. Hansen"
	<haveblue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>,
	bastian-yyjItF7Rl6lg9hUCZPvPmw@public.gmane.org,
	hpa-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org,
	containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org,
	xemul-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org,
	alan-qBU/x9rampVanCEyBjwyrvXRex20P6io@public.gmane.org,
	ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org
Subject: Re: [RFC][PATCH 6/6]: /dev/tty tweak in init_dev()
Date: Wed, 6 Aug 2008 12:56:45 -0500	[thread overview]
Message-ID: <20080806175645.GA30753@us.ibm.com> (raw)
In-Reply-To: <20080805012637.GF15360-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>

Quoting sukadev-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org (sukadev-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org):
> 
> From: Sukadev Bhattiprolu <sukadev-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
> Subject: [RFC][PATCH 6/6]: /dev/tty tweak in init_dev()
> 
> When opening /dev/tty, __tty_open() finds the tty using get_current_tty().
> When __tty_open() calls init_dev(), init_dev() tries to 'find' the tty
> again from devpts.  Is that really necessary ?
> 
> The problem with asking devpts again is that with multiple mounts, devpts
> cannot find the tty without knowing the specific mount instance. We can't
> find the mount instance of devpts, since the inode of /dev/tty is in a
> different filesystem.
> 
> ---
>  drivers/char/tty_io.c |    5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> Index: linux-2.6.26-rc8-mm1/drivers/char/tty_io.c
> ===================================================================
> --- linux-2.6.26-rc8-mm1.orig/drivers/char/tty_io.c	2008-08-04 17:25:20.000000000 -0700
> +++ linux-2.6.26-rc8-mm1/drivers/char/tty_io.c	2008-08-04 17:26:34.000000000 -0700
> @@ -2066,7 +2066,10 @@ static int init_dev(struct tty_driver *d
> 
>  	/* check whether we're reopening an existing tty */
>  	if (driver->flags & TTY_DRIVER_DEVPTS_MEM) {
> -		tty = devpts_get_tty(inode, idx);
> +		if (inode->i_rdev == MKDEV(TTYAUX_MAJOR, 0))
> +			tty = *ret_tty;

I don't understand this.  ret_tty is for returning tty.  For instance in
_ptmx_open() it's passed in completely uninitialized.  Isn't it
dereferenced later in init_dev?

And what you're doing here doesn't really match your patch intro, but
the patch intro doesn't really say what the patch does, it just lists a
problem.  So I'm 100% unclear on what your intent here is.

> +		else
> +			tty = devpts_get_tty(inode, idx);
>  		/*
>  		 * If we don't have a tty here on a slave open, it's because
>  		 * the master already started the close process and there's

  parent reply	other threads:[~2008-08-06 17:56 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-05  1:18 [RFC][PATCH 0/6] Enable multiple mounts of devpts sukadev-r/Jw6+rmf7HQT0dZR+AlfA
     [not found] ` <20080805011844.GA14940-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2008-08-05  1:22   ` [RFC][PATCH 1/6] Pass-in 'struct inode' to devpts interfaces sukadev-r/Jw6+rmf7HQT0dZR+AlfA
2008-08-05  1:22   ` [RFC][PATCH 2/6] Remove 'devpts_root' global sukadev-r/Jw6+rmf7HQT0dZR+AlfA
2008-08-05  1:23   ` [RFC][PATCH 3/6] Move 'allocated_ptys' to sb->s_s_fs_info sukadev-r/Jw6+rmf7HQT0dZR+AlfA
2008-08-05  1:23   ` [RFC][PATCH 4/6]: Allow mknod of ptmx in devpts sukadev-r/Jw6+rmf7HQT0dZR+AlfA
2008-08-05  1:24   ` [RFC][PATCH 5/6] Allow multiple mounts of devpts sukadev-r/Jw6+rmf7HQT0dZR+AlfA
2008-08-05  1:26   ` [RFC][PATCH 6/6]: /dev/tty tweak in init_dev() sukadev-r/Jw6+rmf7HQT0dZR+AlfA
     [not found]     ` <20080805012637.GF15360-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2008-08-06 17:56       ` Serge E. Hallyn [this message]
     [not found]         ` <20080806175645.GA30753-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2008-08-06 18:59           ` sukadev-r/Jw6+rmf7HQT0dZR+AlfA
     [not found]             ` <20080806185953.GA26435-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2008-08-06 19:24               ` Serge E. Hallyn
2008-08-05  1:37   ` [RFC][PATCH 0/6] Enable multiple mounts of devpts H. Peter Anvin
     [not found]     ` <4897AECE.9060307-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org>
2008-08-05  1:53       ` sukadev-r/Jw6+rmf7HQT0dZR+AlfA
     [not found]         ` <20080805015334.GA16114-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2008-08-05  2:07           ` H. Peter Anvin
     [not found]             ` <4897B5DC.10502-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org>
2008-08-05  4:57               ` Kyle Moffett
     [not found]                 ` <f73f7ab80808042157k1b22ef89sfa4a9f2dc2603c50-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-08-05  6:15                   ` Eric W. Biederman
     [not found]                     ` <m17iawm1h9.fsf-B27657KtZYmhTnVgQlOflh2eb7JE58TQ@public.gmane.org>
2008-08-06  3:32                       ` Kyle Moffett
     [not found]                         ` <f73f7ab80808052032h483cd746i644e629fafe176b4-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-08-06 19:40                           ` H. Peter Anvin
2008-08-05  1:55   ` H. Peter Anvin

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=20080806175645.GA30753@us.ibm.com \
    --to=serue-r/jw6+rmf7hqt0dzr+alfa@public.gmane.org \
    --cc=alan-qBU/x9rampVanCEyBjwyrvXRex20P6io@public.gmane.org \
    --cc=bastian-yyjItF7Rl6lg9hUCZPvPmw@public.gmane.org \
    --cc=containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org \
    --cc=ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org \
    --cc=haveblue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org \
    --cc=hpa-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org \
    --cc=kyle-hoO6YkzgTuCM0SS3m2neIg@public.gmane.org \
    --cc=sukadev-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org \
    --cc=xemul-GEFAQzZX7r8dnm+yROfE0A@public.gmane.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.