s390-tools/s390-tools-sles15sp2-vmcp-exit-code.patch
Mark Post 58e312617d Accepting request 823200 from home:markkp:branches:Base:System
- The location of the udevadm binary was changed from /sbin/ to /usr/bin
  a while back. A symbolic link was added for compatibility. In the latest
  versions, that symbolic link has been removed, requiring changes to scripts
  that were depending on that.
  Added the following patches for bsc#1171587
  * s390-tools-sles15sp2-lsluns-try-harder-to-find-udevadm.patch
  * s390-tools-sles15sp2-znetconf-introduce-better-ways-to-locate-udevadm.patch
  *s390-tools-sles15sp2-mon_tools-update-udevadm-location.patch
- Added s390-tools-sles15sp2-zipl-prevent-endless-loop-during-IPL.patch
  (bsc#1174309) zipl: prevent endless loop during secure IPL
- Added s390-tools-sles15sp2-zipl-check-for-valid-ipl-parmblock-lowcore-pointer.patch
  (bsc#1174310) zipl: check for valid ipl parmblock lowcore pointer
- Added s390-tools-sles15sp2-01-zipl-libc-libc_stop-move-noreturn-to-declaration.patch
        s390-tools-sles15sp2-02-zipl-stage3-correctly-handle-diag308-response-code.patch
  (bsc1174311) zipl: Fix KVM IPL without bootindex
- Updated cputype and read_values to recognize the new z15 models.
- Added s390-tools-sles15sp2-zipl-prevent-endless-loop-during-IPL.patch
  (bsc#1174309) zipl: prevent endless loop during secure IPL
- Added s390-tools-sles15sp2-zipl-check-for-valid-ipl-parmblock-lowcore-pointer.patch
  (bsc#1174310) zipl: check for valid ipl parmblock lowcore pointer
- Added s390-tools-sles15sp2-01-zipl-libc-libc_stop-move-noreturn-to-declaration.patch
        s390-tools-sles15sp2-02-zipl-stage3-correctly-handle-diag308-response-code.patch
  (bsc1174311) zipl: Fix KVM IPL without bootindex
- Updated cputype and read_values to recognize the new z15 models.
- Added s390-tools-sles15sp2-vmcp-exit-code.patch (bsc#1173481)
  Change the vmcp exit code and return 'CP command failed' when both
  "CP command failed" and "response buffer is too small" error
  conditions are true.

OBS-URL: https://build.opensuse.org/request/show/823200
OBS-URL: https://build.opensuse.org/package/show/Base:System/s390-tools?expand=0&rev=97
2020-07-28 16:49:48 +00:00

74 lines
2.9 KiB
Diff

Subject: [PATCH] [BZ 186342] vmcp: Change sequence of failed exit
From: Thomas Richter <tmricht@linux.ibm.com>
Description: vmcp: Change sequence of failed exit
Symptom: VMCP command fails to execute commands with a very large
response on a very memory constraint system. A kernel log
message appears in the kernel log file:
2020-05-29T10:57:16.543860-05:00 xdrf1 kernel: cma:
cma_alloc: alloc failed, req-size: 8 pages, ret: -16
The vmcp command fails and indicates this in the exit code.
Problem: When vmcp fails to execute a CP command with both error
conditions
- response buffer is too small
- CP command failed
then the vmcp program exits with 'response buffer too small'
indication. However, an exit code indicating
'CP command failed' would be more important in this case.
So change the vmcp exit code and return 'CP command failed'
for above error scenario.
Solution: Change the vmcp exit code and return 'CP command failed'
when both error conditions are true.
Reproduction: Issue vmcp varyoff command on system with low memory and
many DASD devices.
Upstream-ID: 53b949926f1bf0c6070650aae5f474e8df5378df
Problem-ID: 186342
Upstream-Description:
vmcp: Change sequence of failed exit
When vmcp fails to execute a CP command with both error conditions
- response buffer is too small
- CP command failed
then the vmcp program exits with 'response buffer too small' indication.
However, an exit code indicating 'CP command failed' would be more
important in this case.
So change the vmcp exit code and return 'CP command failed' for above
error scenario.
Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
Signed-off-by: Jan Hoeppner <hoeppner@linux.ibm.com>
Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
---
vmcp/vmcp.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
--- a/vmcp/vmcp.c
+++ b/vmcp/vmcp.c
@@ -235,15 +235,15 @@ int main(int argc, char **argv)
write_buffer(STDOUT_FILENO, cp.response,
MIN(cp.response_size, cp.buffer_size));
free(cp.response);
- if (ret == VMCP_ERR_TOOSMALL) {
- fprintf(stderr, "Error: output (%d bytes) was truncated, try "
- "--buffer to increase size\n", cp.response_size);
- return VMCP_BUF;
- }
if (cp.cprc > 0) {
fprintf(stderr, "Error: non-zero CP response for command '%s': "
"#%d\n", command, cp.cprc);
return VMCP_CP;
}
+ if (ret == VMCP_ERR_TOOSMALL) {
+ fprintf(stderr, "Error: output (%d bytes) was truncated, try "
+ "--buffer to increase size\n", cp.response_size);
+ return VMCP_BUF;
+ }
return EXIT_SUCCESS;
}