]> git.baikalelectronics.ru Git - kernel.git/commit
pstore/ram: Write new dumps to start of recycled zones
authorAleksandr Yashkin <a.yashkin@inango-systems.com>
Mon, 23 Dec 2019 13:38:16 +0000 (18:38 +0500)
committerKees Cook <keescook@chromium.org>
Thu, 2 Jan 2020 20:30:50 +0000 (12:30 -0800)
commit06855ee60da82449c5c6b6caddd6bd5f9aed30c4
treec6dd374696a6591278b2078c44c405000f0044d6
parent37ff8c9e605c73c14fbb236c638c564f6fd9b128
pstore/ram: Write new dumps to start of recycled zones

The ram_core.c routines treat przs as circular buffers. When writing a
new crash dump, the old buffer needs to be cleared so that the new dump
doesn't end up in the wrong place (i.e. at the end).

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

Signed-off-by: Aleksandr Yashkin <a.yashkin@inango-systems.com>
Signed-off-by: Nikolay Merinov <n.merinov@inango-systems.com>
Signed-off-by: Ariel Gilman <a.gilman@inango-systems.com>
Link: https://lore.kernel.org/r/20191223133816.28155-1-n.merinov@inango-systems.com
Fixes: 137e83fab945 ("pstore/ram: Switch to persistent_ram routines")
Cc: stable@vger.kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
fs/pstore/ram.c