Skip to content

Commit d85644d

Browse files
guilhermepiccolikees
authored andcommitted
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 0d7cd09 ("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 <[email protected]> Signed-off-by: Kees Cook <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 99b3b83 commit d85644d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

fs/pstore/platform.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -562,8 +562,9 @@ static int pstore_write_user_compat(struct pstore_record *record,
562562
int pstore_register(struct pstore_info *psi)
563563
{
564564
if (backend && strcmp(backend, psi->name)) {
565-
pr_warn("ignoring unexpected backend '%s'\n", psi->name);
566-
return -EPERM;
565+
pr_warn("backend '%s' already in use: ignoring '%s'\n",
566+
backend, psi->name);
567+
return -EBUSY;
567568
}
568569

569570
/* Sanity check flags. */

0 commit comments

Comments
 (0)