xfs
[Top] [All Lists]

[patch] xfstests, aio-dio-extend-stat.c: fix error reporting

To: xfs@xxxxxxxxxxx
Subject: [patch] xfstests, aio-dio-extend-stat.c: fix error reporting
From: Jeff Moyer <jmoyer@xxxxxxxxxx>
Date: Fri, 18 Jan 2013 17:01:57 -0500
Delivered-to: xfs@xxxxxxxxxxx
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.1 (gnu/linux)
Hi,

If we receive an unexpected result from an async write, the error
reporting does not tell the actual number of bytes written.  Fix that,
and also a couple of typos in printf's.

Signed-off-by: Jeff Moyer <jmoyer@xxxxxxxxxx>

diff --git a/src/aio-dio-regress/aio-dio-extend-stat.c 
b/src/aio-dio-regress/aio-dio-extend-stat.c
index a6b4f08..7733f51 100644
--- a/src/aio-dio-regress/aio-dio-extend-stat.c
+++ b/src/aio-dio-regress/aio-dio-extend-stat.c
@@ -141,8 +141,7 @@ void fun_read(void *ptr)
                        struct io_event *event = &ioevents[i];
                        if (event->res != BUFSIZE)
                                fail("error in block: expected %d bytes, "
-                                    "received %ld\n", BUFSIZE,
-                                    event->obj->u.c.nbytes);
+                                    "received %ld\n", BUFSIZE, event->res);
 
                        exSize = event->obj->u.c.offset + 
event->obj->u.c.nbytes;
                        fstat(handle, &filestat);
@@ -164,7 +163,7 @@ void fun_writeN(void *ptr)
        for(i = 0; i < MAX_AIO_EVENTS; ++i) {
                ret = io_submit(ctxp, 1, &(iocbs[i]));
                if (ret != 1)
-                       fail("io_subit returned %d instead of 1\n", ret);
+                       fail("io_submit returned %d instead of 1\n", ret);
        }
 }
 
@@ -174,6 +173,6 @@ void fun_write1(void *ptr)
     
        ret = io_submit(ctxp, MAX_AIO_EVENTS, iocbs);
        if (ret !=  MAX_AIO_EVENTS)
-               fail("io_subit returned %d instead of %u\n", ret,
+               fail("io_submit returned %d instead of %u\n", ret,
                     MAX_AIO_EVENTS);
 }

<Prev in Thread] Current Thread [Next in Thread>
  • [patch] xfstests, aio-dio-extend-stat.c: fix error reporting, Jeff Moyer <=