Re: [PATCH] early init: open /dev/console with O_LARGEFILE

From: Dominik Brodowski
Date: Wed Jan 01 2020 - 05:43:53 EST


@youling 257: could you test the attached patch, please?

Thanks,
Dominik

On Tue, Dec 31, 2019 at 07:30:19PM -0500, Arvind Sankar wrote:
> On Tue, Dec 31, 2019 at 04:02:26PM +0100, Dominik Brodowski wrote:
> > If force_o_largefile() is true, /dev/console used to be opened
> > with O_LARGEFILE. Retain that behaviour.
> >
>
> One other thing that used to happen is fsnotify_open() -- I don't know
> how that might affect this, but it seems like the only thing left that's
> different.

Suggested-by: Arvind Sankar <nivedita@xxxxxxxxxxxx>
Signed-off-by: Dominik Brodowski <linux@xxxxxxxxxxxxxxxxxxxx>

diff --git a/init/main.c b/init/main.c
index d12777775cb0..3f4163046200 100644
--- a/init/main.c
+++ b/init/main.c
@@ -94,6 +94,7 @@
#include <linux/jump_label.h>
#include <linux/mem_encrypt.h>
#include <linux/file.h>
+#include <linux/fsnotify.h>

#include <asm/io.h>
#include <asm/bugs.h>
@@ -1166,6 +1167,7 @@ void console_on_rootfs(void)
O_RDWR | (force_o_largefile() ? O_LARGEFILE : 0), 0);
if (IS_ERR(file))
goto err_out;
+ fsnotify_open(file);

/* create stdin/stdout/stderr, this should never fail */
for (i = 0; i < 3; i++) {