Skip to contentSkip to conversation

pstore/ram: Rate-limit "uncorrectable error in header" message

PATCH Applied Dmitry Osipenko 2 participants 2 messages Mar 2, 2021 – Mar 3, 2021 Pstore filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pstore/ram: Rate-limit "uncorrectable error in header" message

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+.

---
 fs/pstore/ram_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/pstore/ram_core.c +1 -1
index aa8e0b65ff1a..fff363bfd484 100644
@@ -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++;
 	}
 
Signature · 1 line
2.29.2
Applied
#1 lore raw
Quoted 5 lines · Dmitry Osipenko

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
Signature · 1 line
Kees Cook