xfs
[Top] [All Lists]

Re: [PATCH] xfstests: fix async io error handling in fsx

To: Felix Blyakher <felixb@xxxxxxx>
Subject: Re: [PATCH] xfstests: fix async io error handling in fsx
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Mon, 30 Mar 2009 13:54:51 -0400
Cc: xfs@xxxxxxxxxxx
In-reply-to: <1238391050-14211-1-git-send-email-felixb@xxxxxxx>
References: <1238391050-14211-1-git-send-email-felixb@xxxxxxx>
User-agent: Mutt/1.5.18 (2008-05-17)
On Mon, Mar 30, 2009 at 12:30:50AM -0500, Felix Blyakher wrote:
> --- a/ltp/fsx.c
> +++ b/ltp/fsx.c
> @@ -976,19 +976,41 @@ __aio_rw(int rw, int fd, char *buf, unsigned len, 
> unsigned offset)
>               fprintf(stderr, "errcode=%d\n", ret);
>               fprintf(stderr, "aio_rw: io_submit failed: %s\n",
>                               strerror(ret));
> -             return(-1);
> +             errno = -ret;
> +             return -1;

I think we'd be better off having all these places that set errno in one
place and use goto labels.  That way you can also add a small comment
about it.

> +             /*
> +              * The b0rked libaio defines event.res as signed.
> +              * However the kernel strucuture has it unsigned,
> +              * and it's used to pass negated error value.
> +              * Till the library is fixed use the temp var.
> +              */

This comment seems backwards to the patch description and the actual
code.

<Prev in Thread] Current Thread [Next in Thread>