mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2025-01-22 13:54:57 +08:00
pstore: Improve error reporting in case of backend overlap
The pstore infrastructure supports one single backend at a time;
trying to load a another backend causes an error and displays a
message, introduced on commit 0d7cd09a3d
("pstore: Improve
register_pstore() error reporting").
Happens that this message is not really clear about the situation,
also the current error returned (-EPERM) isn't accurate, whereas
-EBUSY makes more sense. We have another place in the code that
relies in the -EBUSY return for a similar check.
So, make it consistent here by returning -EBUSY and using a
similar message in both scenarios.
Signed-off-by: Guilherme G. Piccoli <gpiccoli@igalia.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20221006224212.569555-2-gpiccoli@igalia.com
This commit is contained in:
parent
99b3b83785
commit
d85644dc5c
@ -562,8 +562,9 @@ out:
|
||||
int pstore_register(struct pstore_info *psi)
|
||||
{
|
||||
if (backend && strcmp(backend, psi->name)) {
|
||||
pr_warn("ignoring unexpected backend '%s'\n", psi->name);
|
||||
return -EPERM;
|
||||
pr_warn("backend '%s' already in use: ignoring '%s'\n",
|
||||
backend, psi->name);
|
||||
return -EBUSY;
|
||||
}
|
||||
|
||||
/* Sanity check flags. */
|
||||
|
Loading…
Reference in New Issue
Block a user