diff options
author | Kees Cook <keescook@chromium.org> | 2020-05-07 02:34:42 +0300 |
---|---|---|
committer | Kees Cook <keescook@chromium.org> | 2020-05-30 20:34:02 +0300 |
commit | b7753fc7f6f5626e51ee78156fd801fb52163af0 (patch) | |
tree | 65be713bc464cea37e20f08c9d665cacb0bea5fb /fs | |
parent | 609e28bb139e53621521130f0d4aea27a725d465 (diff) | |
download | linux-b7753fc7f6f5626e51ee78156fd801fb52163af0.tar.xz |
pstore: Make sure console capturing will restart
The CON_ENABLED flag gets cleared during unregister_console(), so make
sure we already reset the console flags before calling register_console(),
otherwise unloading and reloading a pstore backend will not restart
console logging.
Signed-off-by: Kees Cook <keescook@chromium.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/pstore/platform.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c index 398785ab059f..8beaeff72386 100644 --- a/fs/pstore/platform.c +++ b/fs/pstore/platform.c @@ -516,12 +516,16 @@ static void pstore_console_write(struct console *con, const char *s, unsigned c) static struct console pstore_console = { .name = "pstore", .write = pstore_console_write, - .flags = CON_PRINTBUFFER | CON_ENABLED | CON_ANYTIME, .index = -1, }; static void pstore_register_console(void) { + /* + * Always initialize flags here since prior unregister_console() + * calls may have changed settings (specifically CON_ENABLED). + */ + pstore_console.flags = CON_PRINTBUFFER | CON_ENABLED | CON_ANYTIME; register_console(&pstore_console); } |