Skip to contentSkip to conversation

kexec-tools: print error if kexec_file_load fails

PATCH New Hari Bathini 3 participants 3 messages Mar 16, 2022 – Mar 23, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kexec-tools: print error if kexec_file_load fails

Commit 4f77da634035 ("kexec-tools: Fix kexec_file_load(2) error handling") introduced EFALLBACK for scenarios where fallbacking back to kexec_load syscall is likely to work and dropped printing error message for these scenarios. But printing error message for other failure scenarios was inadvertently dropped. Restore printing error message for such cases.

Fixes 4f77da634035 ("kexec-tools: Fix kexec_file_load(2) error handling")
Cc Petr Tesarik <[email protected]>
---
 kexec/kexec.c | 1 +
 1 file changed, 1 insertion(+)
kexec/kexec.c +1 -0
index 7e4787b..865de61 100644
@@ -1339,6 +1339,7 @@ static int do_kexec_file_load(int fileind, int argc, char **argv,
 		case EMSGSIZE:
 			/* Reject by default. */
 		default:
+			fprintf(stderr, "kexec_file_load failed: %s\n", strerror(errno));
 			ret = EFAILED;
 			break;
 
Signature · 1 line
2.35.1
#1 lore raw

PATCH 1/1 kexec-tools: print error if kexec_file_load fails

Hi Hari,

Dne 16. 03. 22 v 11:33 Hari Bathini napsal(a):

Quoted 6 lines

Commit 4f77da634035 ("kexec-tools: Fix kexec_file_load(2) error handling") introduced EFALLBACK for scenarios where fallbacking back to kexec_load syscall is likely to work and dropped printing error message for these scenarios. But printing error message for other failure scenarios was inadvertently dropped. Restore printing error message for such cases.

Indeed, my commit removed the error messages on failure.

Quoted 6 lines
Fixes 4f77da634035 ("kexec-tools: Fix kexec_file_load(2) error handling")
Cc Petr Tesarik <[email protected]>

Petr T

Quoted 9 lines
---
  kexec/kexec.c | 1 +
  1 file changed, 1 insertion(+)
kexec/kexec.c +0 -0
index 7e4787b..865de61 100644

kexec/kexec.c static int do_kexec_file_load(int fileind, int argc, char **argv, · line 1345

Quoted 7 lines
kexec/kexec.c +1 -0
@@ -1339,6 +1339,7 @@ static int do_kexec_file_load(int fileind, int argc, char **argv,
  		case EMSGSIZE:
  			/* Reject by default. */
  		default:
+			fprintf(stderr, "kexec_file_load failed: %s\n", strerror(errno));
  			ret = EFAILED;
  			break;
 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_0xAA503BC9AE0F47A7.asc
Type: application/pgp-keys
Size: 18487 bytes
Desc: OpenPGP public key
URL: <http://lists.infradead.org/pipermail/kexec/attachments/20220316/06bb02e3/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 495 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/kexec/attachments/20220316/06bb02e3/attachment-0001.sig>

Applied
#2 lore raw

PATCH 1/1 kexec-tools: print error if kexec_file_load fails

Quoted 13 lines · Petr Tesarik

Hi Hari,

Dne 16. 03. 22 v 11:33 Hari Bathini napsal(a):

Quoted 6 lines

Commit 4f77da634035 ("kexec-tools: Fix kexec_file_load(2) error handling") introduced EFALLBACK for scenarios where fallbacking back to kexec_load syscall is likely to work and dropped printing error message for these scenarios. But printing error message for other failure scenarios was inadvertently dropped. Restore printing error message for such cases.

Indeed, my commit removed the error messages on failure.

Quoted 1 line
Quoted 7 lines
Quoted 5 lines
Fixes 4f77da634035 ("kexec-tools: Fix kexec_file_load(2) error handling")
Cc Petr Tesarik <[email protected]>

Thanks, applied.