summaryrefslogtreecommitdiff
path: root/fs/pstore
diff options
context:
space:
mode:
authorJoel Fernandes (Google) <joel@joelfernandes.org>2018-10-17 03:13:55 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-05-22 07:37:45 +0200
commitfea8b84765a12c5c2aef32602381d9ffcc6d3507 (patch)
treeabfe99669898aef56cc045246e0b873b715928e9 /fs/pstore
parentf4bf101be366d1075767f21a10b1bf587ce2a52f (diff)
pstore: Allocate compression during late_initcall()
commit 416031653eb55f844e3547fb8f8576399a800da0 upstream. ramoops's call of pstore_register() was recently moved to run during late_initcall() because the crypto backend may not have been ready during postcore_initcall(). This meant early-boot crash dumps were not getting caught by pstore any more. Instead, lets allow calls to pstore_register() earlier, and once crypto is ready we can initialize the compression. Reported-by: Sai Prakash Ranjan <saiprakash.ranjan@codeaurora.org> Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org> Tested-by: Sai Prakash Ranjan <saiprakash.ranjan@codeaurora.org> Fixes: cb3bee0369bc ("pstore: Use crypto compress API") [kees: trivial rebase] Signed-off-by: Kees Cook <keescook@chromium.org> Tested-by: Guenter Roeck <groeck@chromium.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/pstore')
-rw-r--r--fs/pstore/platform.c10
-rw-r--r--fs/pstore/ram.c2
2 files changed, 10 insertions, 2 deletions
diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c
index d61e26812af6..578f178a695f 100644
--- a/fs/pstore/platform.c
+++ b/fs/pstore/platform.c
@@ -786,13 +786,21 @@ static int __init pstore_init(void)
pstore_choose_compression();
+ /*
+ * Check if any pstore backends registered earlier but did not
+ * initialize compression because crypto was not ready. If so,
+ * initialize compression now.
+ */
+ if (psinfo && !tfm)
+ allocate_buf_for_compression();
+
ret = pstore_init_fs();
if (ret)
return ret;
return 0;
}
-module_init(pstore_init)
+late_initcall(pstore_init);
static void __exit pstore_exit(void)
{
diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c
index eb67bb7f04de..44ed6b193d2e 100644
--- a/fs/pstore/ram.c
+++ b/fs/pstore/ram.c
@@ -956,7 +956,7 @@ static int __init ramoops_init(void)
return ret;
}
-late_initcall(ramoops_init);
+postcore_initcall(ramoops_init);
static void __exit ramoops_exit(void)
{