summaryrefslogtreecommitdiffstats
path: root/fs/pstore
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung@kernel.org>2016-07-28 00:08:26 +0900
committerKees Cook <keescook@chromium.org>2016-09-08 15:01:09 -0700
commit79d955af711a6e20207783590a2cfddbd649568b (patch)
treefa5c5b48bc906472a5049437337372f0164b080d /fs/pstore
parentc950fd6f201aea649932898206a850f0a7f25603 (diff)
downloadlinux-stable-79d955af711a6e20207783590a2cfddbd649568b.tar.gz
linux-stable-79d955af711a6e20207783590a2cfddbd649568b.tar.bz2
linux-stable-79d955af711a6e20207783590a2cfddbd649568b.zip
pstore/ram: Set pstore flags dynamically
The ramoops can be configured to enable each pstore type by setting their size. In that case, it'd be better not to register disabled types in the first place. Cc: Anton Vorontsov <anton@enomsg.org> Cc: Colin Cross <ccross@android.com> Cc: Kees Cook <keescook@chromium.org> Cc: Tony Luck <tony.luck@intel.com> Signed-off-by: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Kees Cook <keescook@chromium.org>
Diffstat (limited to 'fs/pstore')
-rw-r--r--fs/pstore/ram.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c
index c2ebf5084977..08597c524439 100644
--- a/fs/pstore/ram.c
+++ b/fs/pstore/ram.c
@@ -623,7 +623,13 @@ static int ramoops_probe(struct platform_device *pdev)
goto fail_clear;
}
- cxt->pstore.flags = PSTORE_FLAGS_ALL;
+ cxt->pstore.flags = PSTORE_FLAGS_DMESG;
+ if (cxt->console_size)
+ cxt->pstore.flags |= PSTORE_FLAGS_CONSOLE;
+ if (cxt->ftrace_size)
+ cxt->pstore.flags |= PSTORE_FLAGS_FTRACE;
+ if (cxt->pmsg_size)
+ cxt->pstore.flags |= PSTORE_FLAGS_PMSG;
err = pstore_register(&cxt->pstore);
if (err) {