Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

pstore: Don't allow high traffic options on fragile devices

Some pstore backing devices use on board flash as persistent
storage. These have limited numbers of write cycles so it
is a poor idea to use them from high frequency operations.

Signed-off-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Luck, Tony and committed by
Linus Torvalds
df36ac1b eaadcfeb

+10 -2
+1
drivers/acpi/apei/erst.c
··· 942 942 static struct pstore_info erst_info = { 943 943 .owner = THIS_MODULE, 944 944 .name = "erst", 945 + .flags = PSTORE_FLAGS_FRAGILE, 945 946 .open = erst_open_pstore, 946 947 .close = erst_close_pstore, 947 948 .read = erst_reader,
+1
drivers/firmware/efi/efi-pstore.c
··· 356 356 static struct pstore_info efi_pstore_info = { 357 357 .owner = THIS_MODULE, 358 358 .name = "efi", 359 + .flags = PSTORE_FLAGS_FRAGILE, 359 360 .open = efi_pstore_open, 360 361 .close = efi_pstore_close, 361 362 .read = efi_pstore_read,
+5 -2
fs/pstore/platform.c
··· 443 443 pstore_get_records(0); 444 444 445 445 kmsg_dump_register(&pstore_dumper); 446 - pstore_register_console(); 447 - pstore_register_ftrace(); 446 + 447 + if ((psi->flags & PSTORE_FLAGS_FRAGILE) == 0) { 448 + pstore_register_console(); 449 + pstore_register_ftrace(); 450 + } 448 451 449 452 if (pstore_update_ms >= 0) { 450 453 pstore_timer.expires = jiffies +
+3
include/linux/pstore.h
··· 51 51 char *buf; 52 52 size_t bufsize; 53 53 struct mutex read_mutex; /* serialize open/read/close */ 54 + int flags; 54 55 int (*open)(struct pstore_info *psi); 55 56 int (*close)(struct pstore_info *psi); 56 57 ssize_t (*read)(u64 *id, enum pstore_type_id *type, ··· 70 69 struct pstore_info *psi); 71 70 void *data; 72 71 }; 72 + 73 + #define PSTORE_FLAGS_FRAGILE 1 73 74 74 75 #ifdef CONFIG_PSTORE 75 76 extern int pstore_register(struct pstore_info *);