Thread (19 messages) 19 messages, 1 author, 2020-05-09
STALE2247d
Revisions (4)
  1. v4 [diff vs current]
  2. v6 current
  3. v7 [diff vs current]
  4. v8 [diff vs current]

[PATCH v6 04/18] pstore/platform: Use backend name for console registration

From: Kees Cook <hidden>
Date: 2020-05-09 23:41:10
Also in: lkml
Subsystem: filesystems (vfs and infrastructure), pstore filesystem, the rest · Maintainers: Alexander Viro, Christian Brauner, Kees Cook, Linus Torvalds

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.

Signed-off-by: Kees Cook <redacted>
---
 fs/pstore/platform.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c
index bf7fa7b278bd..90d146fbc7d2 100644
--- a/fs/pstore/platform.c
+++ b/fs/pstore/platform.c
@@ -519,13 +519,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).
-- 
2.20.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help