]> git.baikalelectronics.ru Git - kernel.git/commit
pstore/blk: Introduce backend for block devices
authorWeiXiong Liao <liaoweixiong@allwinnertech.com>
Wed, 25 Mar 2020 08:54:57 +0000 (16:54 +0800)
committerKees Cook <keescook@chromium.org>
Sat, 30 May 2020 17:34:03 +0000 (10:34 -0700)
commitf9edd43ea779940c1749faa3bdefa64a4044fac2
tree029d85bdaab1530b7b76d47e2033137864857afc
parent791d42f7d65dde8fce751119557c87224f21f3f1
pstore/blk: Introduce backend for block devices

pstore/blk is similar to pstore/ram, but uses a block device as the
storage rather than persistent ram.

The pstore/blk backend solves two common use-cases that used to preclude
using pstore/ram:
- not all devices have a battery that could be used to persist
  regular RAM across power failures.
- most embedded intelligent equipment have no persistent ram, which
  increases costs, instead preferring cheaper solutions, like block
  devices.

pstore/blk provides separate configurations for the end user and for the
block drivers. User configuration determines how pstore/blk operates, such
as record sizes, max kmsg dump reasons, etc. These can be set by Kconfig
and/or module parameters, but module parameter have priority over Kconfig.
Driver configuration covers all the details about the target block device,
such as total size of the device and how to perform read/write operations.
These are provided by block drivers, calling pstore_register_blkdev(),
including an optional panic_write callback used to bypass regular IO
APIs in an effort to avoid potentially destabilized kernel code during
a panic.

Signed-off-by: WeiXiong Liao <liaoweixiong@allwinnertech.com>
Link: https://lore.kernel.org/lkml/20200511233229.27745-3-keescook@chromium.org/
Co-developed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Kees Cook <keescook@chromium.org>
fs/pstore/Kconfig
fs/pstore/Makefile
fs/pstore/blk.c [new file with mode: 0644]
include/linux/pstore_blk.h [new file with mode: 0644]