[<prev] [next>] [day] [month] [year] [list]
Message-Id: <bd48fa6ca65fadb9ab84a8fec6f0b0ed5e4f2fd4.1723464485.git.chen.haonan2@zte.com.cn>
Date: Mon, 12 Aug 2024 21:40:45 +0800
From: chenguanxi11234@....com
To: kees@...nel.org
Cc: chen.haonan2@....com.cn,
yang.guang5@....com.cn,
tony.luck@...el.com,
gpiccoli@...lia.com,
linux-hardening@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH linux-next] pstore/ram: Fix pstore lost information
From: Chen Haonan <chen.haonan2@....com.cn>
persistent_ram_zap() is used to clear relevant log messages
in dmesg, but in other cases it is not needed.In particular,
in console and pmsg, it will cause that after we perform
a delete operation, the next time the system is reset, we
will only see the logs after performing the delete operation.
Signed-off-by: Chen Haonan <chen.haonan2@....com.cn>
---
fs/pstore/ram.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c
index 4311fcbc84f2..4cb6e96df6b9 100644
--- a/fs/pstore/ram.c
+++ b/fs/pstore/ram.c
@@ -436,7 +436,8 @@ static int ramoops_pstore_erase(struct pstore_record *record)
}
persistent_ram_free_old(prz);
- persistent_ram_zap(prz);
+ if (record->type == PSTORE_TYPE_DMESG)
+ persistent_ram_zap(prz);
return 0;
}
--
2.25.1
Powered by blists - more mailing lists