Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1606959ybl; Wed, 18 Dec 2019 23:10:54 -0800 (PST) X-Google-Smtp-Source: APXvYqySo0xbbI3xGAI4L864y+Qnm9AjLn/Mp/4B6eFTHU+1dShH5/vggtYZT2TPXdDEhIgV8NQo X-Received: by 2002:a05:6830:16c6:: with SMTP id l6mr7424971otr.186.1576739454335; Wed, 18 Dec 2019 23:10:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576739454; cv=none; d=google.com; s=arc-20160816; b=T6+Isu2GZEke6w3ZefW67hfQy4hRKRk5AFBM92tT3xl+Veb3GG805PvjHVIgmrxL6y jiXMJEs8wRieHXuDQv5Qih0zkJmkZ9dw6lqwv7wqEEcl1udoBp30Y58CU0M038mtxjjU U4sNfldPFAKS30ZfYASFmEr19ozGCZxS1Ejq68TMvxUdMJ6Hzz+3/qEZwePlCf1uYpjv 8rUt4JEj2RUuh5K5KkaY3u5gMxy1HVOAckpHvECKL/rICww7h3V4qIEFB4g5fYtEXyWf tIbotUtdS4ado65ZLQ+TmmMmuh84x7jvc19GemZiYG+5rbcqbmpXjapJ5VX162p+XEY5 ptpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=exqAVGJYK29YXl3B07sRDzAFbtgFnA9dRFbLWkUdFR8=; b=LYomJ1SZ6wfTMqmUk7LKiYDnkkebrAO8zm6Awu+P/HuonTHPf73ZopT5604vTuxy6b Hz/UpYKKGN+uJSGJDfNLL4o+MxusS3G+3+VjnSULbiDlbXN7RDxTJtxuootI9Hq5M738 AaCHB8qsb6IIS1+JdQqnd90xODvbeqBiu+ZpZaJcgqhJieZUazMBvSdgIhwJVhIUMG4Q J1nrhb3cjJTD8Io6MoNqGX0TdEDbXWd/plDisORKezsFupMvLRthULCljQGl70bqaCIx 9pDa0FHUibsS1h6zq5prbEQvlWkvyM+sbIM6Ig7u/F7BE8ok0PaVrtnww5g1xW6LiZrA 2nGg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v13si2915051oth.280.2019.12.18.23.10.43; Wed, 18 Dec 2019 23:10:54 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726668AbfLSHIs (ORCPT + 99 others); Thu, 19 Dec 2019 02:08:48 -0500 Received: from isilmar-4.linta.de ([136.243.71.142]:49774 "EHLO isilmar-4.linta.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726294AbfLSHIr (ORCPT ); Thu, 19 Dec 2019 02:08:47 -0500 X-isilmar-external: YES X-isilmar-external: YES X-isilmar-external: YES X-isilmar-external: YES X-isilmar-external: YES X-isilmar-external: YES X-isilmar-external: YES X-isilmar-external: YES Received: from light.dominikbrodowski.net (brodo.linta [10.1.0.102]) by isilmar-4.linta.de (Postfix) with ESMTPSA id 58C662009A2; Thu, 19 Dec 2019 07:08:46 +0000 (UTC) Received: by light.dominikbrodowski.net (Postfix, from userid 1000) id 189DD20BB5; Thu, 19 Dec 2019 08:08:36 +0100 (CET) Date: Thu, 19 Dec 2019 08:08:36 +0100 From: Dominik Brodowski To: youling 257 Cc: Linus Torvalds , Al Viro , Greg Kroah-Hartman , Rafael Wysocki , Andrew Morton , Ingo Molnar , Linux Kernel Mailing List Subject: Re: [PATCH 4/5] init: unify opening /dev/console as stdin/stdout/stderr Message-ID: <20191219070836.GA496264@light.dominikbrodowski.net> References: <20191212181422.31033-1-linux@dominikbrodowski.net> <20191217051751.7998-1-youling257@gmail.com> <20191217064254.GB3247@light.dominikbrodowski.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 19, 2019 at 05:50:19AM +0800, youling 257 wrote: > 2019-12-18 5:14 GMT+08:00, Linus Torvalds : > > This should be fixed by 2d3145f8d280 ("early init: fix error handling > > when opening /dev/console") > > this fix no help for me. > > > I'm not sure what you did to trigger that bug, but it was a bug. > > alt+f1, type bash command, > bash: cannot set terminal process group (-1): Inappropriate ioctl for device > bash: no job control in this shell Could you test this patch, please? And if it does not work: What is the content of /proc/1/fd/ and /proc/1/fdinfo/* for the working and non-working case? That are the only changes visible to userspace... Thanks, Dominik diff --git a/init/main.c b/init/main.c index 1ecfd43ed464..8886530e9dec 100644 --- a/init/main.c +++ b/init/main.c @@ -1162,7 +1162,7 @@ void console_on_rootfs(void) unsigned int i; /* Open /dev/console in kernelspace, this should never fail */ - file = filp_open("/dev/console", O_RDWR, 0); + file = filp_open("/dev/console", force_o_largefile() ? O_LARGEFILE | O_RDWR : O_RDWR, 0); if (IS_ERR(file)) goto err_out;