* [PATCH AUTOSEL 4.14 1/2] pstore/ram: Rate-limit "uncorrectable error in header" message
@ 2021-03-07 13:58 Sasha Levin
2021-03-07 13:58 ` [PATCH AUTOSEL 4.14 2/2] tracing: Skip selftests if tracing is disabled Sasha Levin
0 siblings, 1 reply; 2+ messages in thread
From: Sasha Levin @ 2021-03-07 13:58 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: Dmitry Osipenko, Kees Cook, Sasha Levin
From: Dmitry Osipenko <digetx@gmail.com>
[ Upstream commit 7db688e99c0f770ae73e0f1f3fb67f9b64266445 ]
There is a quite huge "uncorrectable error in header" flood in KMSG
on a clean system boot since there is no pstore buffer saved in RAM.
Let's silence the redundant noisy messages by rate-limiting the printk
message. Now there are maximum 10 messages printed repeatedly instead
of 35+.
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20210302095850.30894-1-digetx@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/pstore/ram_core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/pstore/ram_core.c b/fs/pstore/ram_core.c
index 11e558efd61e..a953d5f04ea0 100644
--- a/fs/pstore/ram_core.c
+++ b/fs/pstore/ram_core.c
@@ -237,7 +237,7 @@ static int persistent_ram_init_ecc(struct persistent_ram_zone *prz,
pr_info("error in header, %d\n", numerr);
prz->corrected_bytes += numerr;
} else if (numerr < 0) {
- pr_info("uncorrectable error in header\n");
+ pr_info_ratelimited("uncorrectable error in header\n");
prz->bad_blocks++;
}
--
2.30.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH AUTOSEL 4.14 2/2] tracing: Skip selftests if tracing is disabled
2021-03-07 13:58 [PATCH AUTOSEL 4.14 1/2] pstore/ram: Rate-limit "uncorrectable error in header" message Sasha Levin
@ 2021-03-07 13:58 ` Sasha Levin
0 siblings, 0 replies; 2+ messages in thread
From: Sasha Levin @ 2021-03-07 13:58 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: Steven Rostedt (VMware), Sasha Levin
From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
[ Upstream commit ee666a185558ac9a929e53b902a568442ed62416 ]
If tracing is disabled for some reason (traceoff_on_warning, command line,
etc), the ftrace selftests are guaranteed to fail, as their results are
defined by trace data in the ring buffers. If the ring buffers are turned
off, the tests will fail, due to lack of data.
Because tracing being disabled is for a specific reason (warning, user
decided to, etc), it does not make sense to enable tracing to run the self
tests, as the test output may corrupt the reason for the tracing to be
disabled.
Instead, simply skip the self tests and report that they are being skipped
due to tracing being disabled.
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/trace/trace.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 3a0691c64704..8dbc21ca140d 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -1478,6 +1478,12 @@ static int run_tracer_selftest(struct tracer *type)
if (!selftests_can_run)
return save_selftest(type);
+ if (!tracing_is_on()) {
+ pr_warn("Selftest for tracer %s skipped due to tracing disabled\n",
+ type->name);
+ return 0;
+ }
+
/*
* Run a selftest on this tracer.
* Here we reset the trace buffer, and set the current
--
2.30.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-03-07 13:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-07 13:58 [PATCH AUTOSEL 4.14 1/2] pstore/ram: Rate-limit "uncorrectable error in header" message Sasha Levin
2021-03-07 13:58 ` [PATCH AUTOSEL 4.14 2/2] tracing: Skip selftests if tracing is disabled Sasha Levin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox