Skip to content

Commit

Permalink
powerpc/kexec_file: Fix error code when trying to load kdump kernel
Browse files Browse the repository at this point in the history
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: a045828 ("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]>
  • Loading branch information
bauermann authored and mpe committed Mar 31, 2018
1 parent 7e14059 commit bf8a1ab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/powerpc/kernel/machine_kexec_file_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit bf8a1ab

Please sign in to comment.