]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
pstore: Improve register_pstore() error reporting
authorKees Cook <keescook@chromium.org>
Fri, 3 Mar 2017 20:11:40 +0000 (12:11 -0800)
committerKees Cook <keescook@chromium.org>
Tue, 7 Mar 2017 16:21:38 +0000 (08:21 -0800)
Uncommon errors are better to get reported to dmesg so developers can
more easily figure out why pstore is unhappy with a backend attempting
to register.

Signed-off-by: Kees Cook <keescook@chromium.org>
fs/pstore/platform.c

index d69ef8a840b96152568073034b3c7d73377f2261..320a673ecb5be4da8298dbfd3441c1c52bf13d05 100644 (file)
@@ -673,11 +673,15 @@ int pstore_register(struct pstore_info *psi)
 {
        struct module *owner = psi->owner;
 
-       if (backend && strcmp(backend, psi->name))
+       if (backend && strcmp(backend, psi->name)) {
+               pr_warn("ignoring unexpected backend '%s'\n", psi->name);
                return -EPERM;
+       }
 
        spin_lock(&pstore_lock);
        if (psinfo) {
+               pr_warn("backend '%s' already loaded: ignoring '%s'\n",
+                       psinfo->name, psi->name);
                spin_unlock(&pstore_lock);
                return -EBUSY;
        }