[lkml]   [2019]   [Dec]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH] pstore/ram: fix for adding dumps to non-empty zone
From: Aleksandr Yashkin <>

The circle buffer in ramoops zones has a problem for adding a new
oops dump to already an existing one.

The solution to this problem is to reset the circle buffer state before
writing a new oops dump.

Signed-off-by: Aleksandr Yashkin <>
Signed-off-by: Nikolay Merinov <>
Signed-off-by: Ariel Gilman <>

diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c
index 8caff834f002..33fceadbf515 100644
--- a/fs/pstore/ram.c
+++ b/fs/pstore/ram.c
@@ -407,6 +407,13 @@ static int notrace ramoops_pstore_write(struct pstore_record *record)

prz = cxt->dprzs[cxt->dump_write_cnt];

+ /* Clean the buffer from old info.
+ * `ramoops_read_kmsg_hdr' expects to find a header in the beginning of
+ * buffer data, so we must to reset the buffer values, in order to
+ * ensure that the header will be written to the beginning of the buffer
+ */
+ persistent_ram_zap(prz);
/* Build header and append record contents. */
hlen = ramoops_write_kmsg_hdr(prz, record);
if (!hlen)
 \ /
  Last update: 2019-12-23 14:45    [W:0.055 / U:5.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site