Skip to contentSkip to conversation

pstore: Add prefix to ECC messages

PATCH Applied Vincent Whitchurch 2 participants 2 messages Mar 1, 2022 Pstore filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pstore: Add prefix to ECC messages

The "No errors detected" message from the ECC code is shown at the end of the pstore log and can be confusing or misleading, especially since it usually appears just after a kernel crash log which normally means quite the opposite of "no errors". Prefix the message to clarify that this message is only about ECC-detected errors.

---
 fs/pstore/ram_core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/pstore/ram_core.c +2 -2
index fe5305028c6e..a89e33719fcf 100644
@@ -263,10 +263,10 @@ ssize_t persistent_ram_ecc_string(struct persistent_ram_zone *prz,
 
 	if (prz->corrected_bytes || prz->bad_blocks)
 		ret = snprintf(str, len, ""
-			"\n%d Corrected bytes, %d unrecoverable blocks\n",
+			"\nECC: %d Corrected bytes, %d unrecoverable blocks\n",
 			prz->corrected_bytes, prz->bad_blocks);
 	else
-		ret = snprintf(str, len, "\nNo errors detected\n");
+		ret = snprintf(str, len, "\nECC: No errors detected\n");
 
 	return ret;
 }
Signature · 1 line
2.34.1
Applied
#1 lore raw
Quoted 8 lines · Vincent Whitchurch

The "No errors detected" message from the ECC code is shown at the end of the pstore log and can be confusing or misleading, especially since it usually appears just after a kernel crash log which normally means quite the opposite of "no errors". Prefix the message to clarify that this message is only about ECC-detected errors.

[...]

Excellent point. :)

Applied to for-next/pstore, thanks!

[1/1] pstore: Add prefix to ECC messages

      https://git.kernel.org/kees/c/023bbde3db41
Signature · 1 line
Kees Cook