Skip to content

Commit 8f5de3f

Browse files
guilhermepiccolikees
authored andcommitted
pstore: Expose kmsg_bytes as a module parameter
Currently this tuning is only exposed as a filesystem option, but most Linux distros automatically mount pstore, hence changing this setting requires remounting it. Also, if that mount option wasn't explicitly set it doesn't show up in mount information, so users cannot check what is the current value of kmsg_bytes. Let's then expose it as a module parameter, allowing both user visibility at all times (even if not manually set) and also the possibility of setting that as a boot/module parameter. Signed-off-by: Guilherme G. Piccoli <[email protected]> Signed-off-by: Kees Cook <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent d85644d commit 8f5de3f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

fs/pstore/platform.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,11 @@ static char *compress =
8989
module_param(compress, charp, 0444);
9090
MODULE_PARM_DESC(compress, "compression to use");
9191

92+
/* How much of the kernel log to snapshot */
93+
unsigned long kmsg_bytes = CONFIG_PSTORE_DEFAULT_KMSG_BYTES;
94+
module_param(kmsg_bytes, ulong, 0444);
95+
MODULE_PARM_DESC(kmsg_bytes, "amount of kernel log to snapshot (in bytes)");
96+
9297
/* Compression parameters */
9398
static struct crypto_comp *tfm;
9499

@@ -100,9 +105,6 @@ struct pstore_zbackend {
100105
static char *big_oops_buf;
101106
static size_t big_oops_buf_sz;
102107

103-
/* How much of the console log to snapshot */
104-
unsigned long kmsg_bytes = CONFIG_PSTORE_DEFAULT_KMSG_BYTES;
105-
106108
void pstore_set_kmsg_bytes(int bytes)
107109
{
108110
kmsg_bytes = bytes;

0 commit comments

Comments
 (0)