lkml.org 
[lkml]   [2019]   [Dec]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH 4/5] init: unify opening /dev/console as stdin/stdout/stderr
On Thu, Dec 19, 2019 at 05:50:19AM +0800, youling 257 wrote:
> 2019-12-18 5:14 GMT+08:00, Linus Torvalds <torvalds@linux-foundation.org>:
> > 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;

\
 
 \ /
  Last update: 2019-12-19 08:09    [W:0.129 / U:3.676 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site