mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arvind Sankar <nivedita@alum.mit.edu>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Arvind Sankar <nivedita@alum.mit.edu>,
	Dominik Brodowski <linux@dominikbrodowski.net>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Al Viro <viro@zeniv.linux.org.uk>,
	youling 257 <youling257@gmail.com>
Subject: Re: [PATCH] early init: open /dev/console with O_LARGEFILE
Date: Wed, 1 Jan 2020 17:50:50 -0500	[thread overview]
Message-ID: <20200101225049.GB438328@rani.riverdale.lan> (raw)
In-Reply-To: <CAHk-=whzgLPi4szh8xOKysuS9CKaQESngc=n0omBVpwdQ822aw@mail.gmail.com>

On Wed, Jan 01, 2020 at 01:39:00PM -0800, Linus Torvalds wrote:
> On Wed, Jan 1, 2020 at 10:32 AM Arvind Sankar <nivedita@alum.mit.edu> wrote:
> >
> > Also, this shouldn't impact the current issue I think, but won't doing
> > filp_open followed by 3 f_dupfd's cause the file->f_count to become 4
> > but with only 3 open fd's? Don't we have to do an fd_install for the
> > first one and only 2 f_dupfd's?
> 
> I think *this* is the real reason for the odd regression.
> 
> Because we're leaking a file count, the original /dev/console stays
> open, and we end up never calling file->f_op->release().
> 
> So we don't call tty_release() on that original /dev/console open, and
> one effect of that is that we never then call session_clear_tty(),
> which should make sure that all the processes in that session ID have
> their controlling tty (signal->tty pointer) cleared.
> 
> And if that original controlling tty wasn't cleared, then subsequent
> calls to set the controlling tty won't do anything, and who knows what
> odd session leader confusion we might have.
> 
> youling, can you check if - instead of the revert - this simple 'add
> an fput' fixes your warning.
> 
> I'm not saying that the revert is wrong at this point, but honestly,
> I'd like to avoid the "we revert because we didn't understand what
> went wrong". It would be good to go "Aaaahhhh, _that_ was the
> problem".
> 
>                  Linus

Shouldn't that only affect init though? The getty's it spawns should be
in their own sessions.

  reply	other threads:[~2020-01-01 22:50 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-31 15:02 Dominik Brodowski
2019-12-31 15:55 ` youling 257
2020-01-01  0:30 ` Arvind Sankar
2020-01-01 10:43   ` Dominik Brodowski
2020-01-01 13:27     ` youling 257
2020-01-01 17:24       ` Dominik Brodowski
2020-01-01 17:59       ` Arvind Sankar
2020-01-01 18:42         ` Dominik Brodowski
2020-01-01 18:49           ` youling 257
2020-01-01 18:32   ` Arvind Sankar
2020-01-01 21:39     ` Linus Torvalds
2020-01-01 22:50       ` Arvind Sankar [this message]
2020-01-01 23:01         ` Linus Torvalds
2020-01-01 23:08           ` Arvind Sankar
2020-01-02  3:09       ` youling 257
2020-01-02  4:00         ` Linus Torvalds
2020-01-02  4:10           ` Arvind Sankar
2020-01-02 17:53       ` Dominik Brodowski

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=20200101225049.GB438328@rani.riverdale.lan \
    --to=nivedita@alum.mit.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@dominikbrodowski.net \
    --cc=torvalds@linux-foundation.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=youling257@gmail.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®