xfstests: fix async io error handling in fsx
authorFelix Blyakher <felixb@sgi.com>
Mon, 6 Apr 2009 15:18:34 +0000 (10:18 -0500)
committerFelix Blyakher <felixb@sgi.com>
Mon, 13 Apr 2009 21:46:00 +0000 (16:46 -0500)
commitd0f0d2f428dc25eb795dcb6ad2886bde36551ef1
tree634bf09b155ac25480895f41de2268ad57aedd3c
parente714acc0ef37031b9a5a522703f2832f139c22e0
xfstests: fix async io error handling in fsx

The result of async io returned in the event.res in addition
to the number of bytes read/written provides negated error
number. The broken libaio defines event.res as unsigned
while the same structure in the kernel defines it as signed.
The kernel indeed treats it as signed, and returns the
negated error number. Till libaio is fixed we provide
the signed long temp var.
Also set errno for each error condition in aio_rw, as the
caller is not aio aware and expects ret(-1)+errno by the
traditional libc convention.

Signed-off-by: Felix Blyakher <felixb@sgi.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
ltp/fsx.c