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.
Unified · Split
| @@ -942,6 +942,7 @@ static int erst_clearer(enum pstore_type_id type, u64 id, int count, · 941 unmodified lines | ||
| 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, |
| @@ -356,6 +356,7 @@ static int efi_pstore_erase(enum pstore_type_id type, u64 id, int count, · 355 unmodified lines | ||
| 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, |
| @@ -443,8 +443,11 @@ int pstore_register(struct pstore_info *psi) · 442 unmodified lines | ||
| 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 + |
| @@ -51,6 +51,7 @@ struct pstore_info { · 50 unmodified lines | ||
| 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,6 +71,8 @@ struct pstore_info { · 13 unmodified lines | ||
| 70 | 71 | void *data; |
| 71 | 72 | }; |
| 72 | 73 | |
| 74 | +#define PSTORE_FLAGS_FRAGILE 1 | |
| 75 | + | |
| 73 | 76 | #ifdef CONFIG_PSTORE |
| 74 | 77 | extern int pstore_register(struct pstore_info *); |
| 75 | 78 | extern bool pstore_cannot_block_path(enum kmsg_dump_reason reason); |