提交 8e48b1a8 编写于 作者: L Lenny Szubowicz 提交者: Tony Luck

pstore: Return unique error if backend registration excluded by kernel param

This is patch 1/3 of a patch set that avoids what misleadingly appears
to be a error during boot:

ERST: Could not register with persistent store

This message is displayed if the system has a valid ACPI ERST table and the
pstore.backend kernel parameter has been used to disable use of ERST by
pstore. But this same message is used for errors that preclude registration.

As part of fixing this, return a unique error status from pstore_register
if the pstore.backend kernel parameter selects a specific facility other
than the requesting facility and check for this condition before any others.
This allows the caller to distinquish this benign case from the other failure
cases.

Also, print an informational console message about which facility
successfully registered as the pstore backend. Since there are various
kernel parameters, config build options, and boot-time errors that can
influence which facility registers with pstore, it's useful to have a
positive indication.
Signed-off-by: NLenny Szubowicz <lszubowi@redhat.com>
Reported-by: NNaotaka Hamaguchi <n.hamaguchi@jp.fujitsu.com>
Signed-off-by: NTony Luck <tony.luck@intel.com>
上级 bf288333
...@@ -239,17 +239,15 @@ int pstore_register(struct pstore_info *psi) ...@@ -239,17 +239,15 @@ int pstore_register(struct pstore_info *psi)
{ {
struct module *owner = psi->owner; struct module *owner = psi->owner;
if (backend && strcmp(backend, psi->name))
return -EPERM;
spin_lock(&pstore_lock); spin_lock(&pstore_lock);
if (psinfo) { if (psinfo) {
spin_unlock(&pstore_lock); spin_unlock(&pstore_lock);
return -EBUSY; return -EBUSY;
} }
if (backend && strcmp(backend, psi->name)) {
spin_unlock(&pstore_lock);
return -EINVAL;
}
if (!psi->write) if (!psi->write)
psi->write = pstore_write_compat; psi->write = pstore_write_compat;
psinfo = psi; psinfo = psi;
...@@ -274,6 +272,9 @@ int pstore_register(struct pstore_info *psi) ...@@ -274,6 +272,9 @@ int pstore_register(struct pstore_info *psi)
add_timer(&pstore_timer); add_timer(&pstore_timer);
} }
pr_info("pstore: Registered %s as persistent store backend\n",
psi->name);
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(pstore_register); EXPORT_SYMBOL_GPL(pstore_register);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册