From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matthias Maennich Date: Fri, 11 Jan 2019 08:53:25 +0000 Subject: [LTP] [PATCH v2 1/2] aio_tio: fix error diagnosis for byte transfers Message-ID: <20190111085326.171826-1-maennich@google.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: ltp@lists.linux.it In case the expected bytes written during an async io operation did not match the actually written ones, the wrong error code (res2) had been reported. Correct that to reflect the error condition (res!=bytes). Signed-off-by: Matthias Maennich --- testcases/kernel/io/aio/aio02/aio_tio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testcases/kernel/io/aio/aio02/aio_tio.c b/testcases/kernel/io/aio/aio02/aio_tio.c index 08fb04162..623c81a5e 100644 --- a/testcases/kernel/io/aio/aio02/aio_tio.c +++ b/testcases/kernel/io/aio/aio02/aio_tio.c @@ -57,7 +57,7 @@ static void work_done(io_context_t ctx, struct iocb *iocb, long res, long res2) if (res != iocb->u.c.nbytes) { fprintf(stderr, "write missed bytes expect %lu got %ld\n", - iocb->u.c.nbytes, res2); + iocb->u.c.nbytes, res); exit(1); } wait_count--; -- 2.20.1.97.g81188d93c3-goog