[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220627111948.003910220@linuxfoundation.org>
Date: Mon, 27 Jun 2022 13:21:27 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org,
Alexander Egorenkov <egorenar@...ux.ibm.com>,
Alexander Gordeev <agordeev@...ux.ibm.com>,
Sasha Levin <sashal@...nel.org>
Subject: [PATCH 5.18 114/181] s390/crash: make copy_oldmem_page() return number of bytes copied
From: Alexander Gordeev <agordeev@...ux.ibm.com>
[ Upstream commit af2debd58bd769e38f538143f0d332e15d753396 ]
Callback copy_oldmem_page() returns either error code or zero.
Instead, it should return the error code or number of bytes copied.
Fixes: df9694c7975f ("s390/dump: streamline oldmem copy functions")
Reviewed-by: Alexander Egorenkov <egorenar@...ux.ibm.com>
Tested-by: Alexander Egorenkov <egorenar@...ux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@...ux.ibm.com>
Signed-off-by: Sasha Levin <sashal@...nel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
arch/s390/kernel/crash_dump.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
--- a/arch/s390/kernel/crash_dump.c
+++ b/arch/s390/kernel/crash_dump.c
@@ -233,9 +233,10 @@ ssize_t copy_oldmem_page(struct iov_iter
rc = copy_oldmem_user(iter->iov->iov_base, src, csize);
else
rc = copy_oldmem_kernel(iter->kvec->iov_base, src, csize);
- if (!rc)
- iov_iter_advance(iter, csize);
- return rc;
+ if (rc < 0)
+ return rc;
+ iov_iter_advance(iter, csize);
+ return csize;
}
/*
Powered by blists - more mailing lists