linux/fs/pstore
Peng Wang 7684bd334d pstore: Avoid duplicate call of persistent_ram_zap()
When initialing a prz, if invalid data is found (no PERSISTENT_RAM_SIG),
the function call path looks like this:

ramoops_init_prz ->
    persistent_ram_new -> persistent_ram_post_init -> persistent_ram_zap
    persistent_ram_zap

As we can see, persistent_ram_zap() is called twice.
We can avoid this by adding an option to persistent_ram_new(), and
only call persistent_ram_zap() when it is needed.

Signed-off-by: Peng Wang <wangpeng15@xiaomi.com>
[kees: minor tweak to exit path and commit log]
Signed-off-by: Kees Cook <keescook@chromium.org>
2018-12-03 16:52:35 -08:00
..
ftrace.c pstore: Remove write_buf() callback 2017-03-07 14:01:02 -08:00
inode.c pstore: Centralize init/exit routines 2018-10-22 07:11:58 -07:00
internal.h pstore: Centralize init/exit routines 2018-10-22 07:11:58 -07:00
Kconfig mm: remove CONFIG_HAVE_MEMBLOCK 2018-10-31 08:54:15 -07:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
platform.c pstore: Remove needless lock during console writes 2018-12-03 16:52:35 -08:00
pmsg.c pstore: Create common record initializer 2017-05-31 10:13:44 -07:00
ram_core.c pstore: Avoid duplicate call of persistent_ram_zap() 2018-12-03 16:52:35 -08:00
ram.c pstore: Avoid duplicate call of persistent_ram_zap() 2018-12-03 16:52:35 -08:00