aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiago Jung Bauermann <[email protected]>2018-03-29 16:05:43 -0300
committerMichael Ellerman <[email protected]>2018-04-01 00:47:44 +1100
commitbf8a1abc3ddbd6e9a8312ea7d96e5dd89c140f18 (patch)
treebcd45aa12cf5a11000da1e4a8004d01f32a2ed29
parent7e1405917c145edbb7d4cd520e890e44161dd7be (diff)
powerpc/kexec_file: Fix error code when trying to load kdump kernel
kexec_file_load() on powerpc doesn't support kdump kernels yet, so it returns -ENOTSUPP in that case. I've recently learned that this errno is internal to the kernel and isn't supposed to be exposed to userspace. Therefore, change to -EOPNOTSUPP which is defined in an uapi header. This does indeed make kexec-tools happier. Before the patch, on ppc64le: # ~bauermann/src/kexec-tools/build/sbin/kexec -s -p /boot/vmlinuz kexec_file_load failed: Unknown error 524 After the patch: # ~bauermann/src/kexec-tools/build/sbin/kexec -s -p /boot/vmlinuz kexec_file_load failed: Operation not supported Fixes: a0458284f062 ("powerpc: Add support code for kexec_file_load()") Cc: [email protected] # v4.10+ Reported-by: Dave Young <[email protected]> Signed-off-by: Thiago Jung Bauermann <[email protected]> Reviewed-by: Simon Horman <[email protected]> Reviewed-by: Dave Young <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>
-rw-r--r--arch/powerpc/kernel/machine_kexec_file_64.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/powerpc/kernel/machine_kexec_file_64.c b/arch/powerpc/kernel/machine_kexec_file_64.c
index e4395f937d63..45e0b7d5f200 100644
--- a/arch/powerpc/kernel/machine_kexec_file_64.c
+++ b/arch/powerpc/kernel/machine_kexec_file_64.c
@@ -43,7 +43,7 @@ int arch_kexec_kernel_image_probe(struct kimage *image, void *buf,
/* We don't support crash kernels yet. */
if (image->type == KEXEC_TYPE_CRASH)
- return -ENOTSUPP;
+ return -EOPNOTSUPP;
for (i = 0; i < ARRAY_SIZE(kexec_file_loaders); i++) {
fops = kexec_file_loaders[i];