summaryrefslogtreecommitdiff
path: root/fs/pstore
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2020-05-08 09:26:28 -0700
committerKees Cook <keescook@chromium.org>2020-05-30 10:34:02 -0700
commitd195c39052d1da278a00a6744ce59c383b67b191 (patch)
tree602e153404b0da6cb4993664876fd1601aa63b4e /fs/pstore
parent563ca40ddf400dbf8c6254077f9b6887101d0f08 (diff)
pstore/platform: Use backend name for console registration
If the pstore backend changes, there's no indication in the logs what the console is (it always says "pstore"). Instead, pass through the active backend's name. (Also adjust the selftest to match.) Link: https://lore.kernel.org/lkml/20200510202436.63222-5-keescook@chromium.org/ Link: https://lore.kernel.org/lkml/20200526135429.GQ12456@shao2-debian Signed-off-by: Kees Cook <keescook@chromium.org>
Diffstat (limited to 'fs/pstore')
-rw-r--r--fs/pstore/platform.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c
index 715396bef0ea..e8690d8606e0 100644
--- a/fs/pstore/platform.c
+++ b/fs/pstore/platform.c
@@ -514,13 +514,15 @@ static void pstore_console_write(struct console *con, const char *s, unsigned c)
}
static struct console pstore_console = {
- .name = "pstore",
.write = pstore_console_write,
.index = -1,
};
static void pstore_register_console(void)
{
+ /* Show which backend is going to get console writes. */
+ strscpy(pstore_console.name, psinfo->name,
+ sizeof(pstore_console.name));
/*
* Always initialize flags here since prior unregister_console()
* calls may have changed settings (specifically CON_ENABLED).