Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Step:15-SP4
s390-tools.15658
s390-tools-sles15sp1-vmcp-exit-code.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File s390-tools-sles15sp1-vmcp-exit-code.patch of Package s390-tools.15658
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 | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) --- a/vmcp/vmcp.c +++ b/vmcp/vmcp.c @@ -244,13 +244,6 @@ int main(int argc, char **argv) return VMCP_LIN; } write_buffer(STDOUT_FILENO, buffer, ret); - if (response_size > buffersize) { - fprintf(stderr, "Error: output (%d bytes) was truncated, try " - "--buffer to increase size\n", response_size); - free(buffer); - close(fd); - return VMCP_BUF; - } if (response_code > 0) { fprintf(stderr, "Error: non-zero CP response for command '%s': " "#%d\n", command, response_code); @@ -258,6 +251,13 @@ int main(int argc, char **argv) close(fd); return VMCP_CP; } + if (response_size > buffersize) { + fprintf(stderr, "Error: output (%d bytes) was truncated, try " + "--buffer to increase size\n", response_size); + free(buffer); + close(fd); + return VMCP_BUF; + } free(buffer); close(fd); return VMCP_OK;
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor