[v1] pstore/ram: Rate-limit "uncorrectable error in header" message
diff mbox series

Message ID 20210302095850.30894-1-digetx@gmail.com
State Accepted
Commit 7db688e99c0f770ae73e0f1f3fb67f9b64266445
Headers show
Series
  • [v1] pstore/ram: Rate-limit "uncorrectable error in header" message
Related show

Commit Message

Dmitry Osipenko March 2, 2021, 9:58 a.m. UTC
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>
---
 fs/pstore/ram_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Kees Cook March 2, 2021, 10:53 p.m. UTC | #1
On Tue, 2 Mar 2021 12:58:50 +0300, Dmitry Osipenko wrote:
> 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+.

Applied to for-next/pstore, thanks!

[1/1] pstore/ram: Rate-limit "uncorrectable error in header" message
      https://git.kernel.org/kees/c/7db688e99c0f

Patch
diff mbox series

diff --git a/fs/pstore/ram_core.c b/fs/pstore/ram_core.c
index aa8e0b65ff1a..fff363bfd484 100644
--- a/fs/pstore/ram_core.c
+++ b/fs/pstore/ram_core.c
@@ -246,7 +246,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++;
 	}