svn commit: r319173 - stable/11/tests/sys/aio
Alan Somers
asomers at freebsd.org
Fri Jun 2 14:37:36 UTC 2017
On Fri, Jun 2, 2017 at 6:50 AM, Glen Barber <gjb at freebsd.org> wrote:
> On Tue, May 30, 2017 at 03:09:01AM +0000, Ngie Cooper wrote:
>> Author: ngie
>> Date: Tue May 30 03:09:01 2017
>> New Revision: 319173
>> URL: https://svnweb.freebsd.org/changeset/base/319173
>>
>> Log:
>> MFC r312913,r318100,r318107:
>>
>> r312913 (by asomers):
>>
>> Improve the aio tests
>>
>> * Add tests for aio_suspend(2).
>> * Add tests for polled completion notification.
>> * Test the full matrix of file descriptor types and completion notification
>> mechanisms.
>> * Don't bother with mkstemp, because ATF runs every test in its own temp dir.
>> * Fix some typos.
>> * Remove extraneous ATF_REQUIRE_KERNEL_MODULE calls.
>>
>> r318100:
>>
>> style(9): move function definition curly braces to column 0
>>
>> r318107:
>>
>> Remove unused constant (PATH_TEMPLATE)
>>
>> It was made unnecessary in r312913.
>>
>> MFC with: r312913
>>
>> Modified:
>> stable/11/tests/sys/aio/aio_test.c
>> Directory Properties:
>> stable/11/ (props changed)
>>
>> Modified: stable/11/tests/sys/aio/aio_test.c
>> ==============================================================================
>> --- stable/11/tests/sys/aio/aio_test.c Tue May 30 03:05:22 2017 (r319172)
>> +++ stable/11/tests/sys/aio/aio_test.c Tue May 30 03:09:01 2017 (r319173)
>> @@ -33,7 +33,7 @@
>> * reading it from a second descriptor using AIO. For some targets, the same
>> * fd is used for write and read (i.e., file, md device), but for others the
>> * operation is performed on a peer (pty, socket, fifo, etc). A timeout is
>> - * initiated to detect undo blocking. This test does not attempt to exercise
>> + * initiated to detect undue blocking. This test does not attempt to exercise
>> * error cases or more subtle asynchronous behavior, just make sure that the
>> * basic operations work on some basic object types.
>> */
>> @@ -63,8 +63,6 @@
>> #include "freebsd_test_suite/macros.h"
>> #include "local.h"
>>
>> -#define PATH_TEMPLATE "aio.XXXXXXXXXX"
>> -
>> /*
>> * GLOBAL_MAX sets the largest usable buffer size to be read and written, as
>> * it sizes ac_buffer in the aio_context structure. It is also the default
>> @@ -74,6 +72,13 @@
>> #define GLOBAL_MAX 16384
>>
>> #define BUFFER_MAX GLOBAL_MAX
>> +
>> +/*
>> + * A completion function will block until the aio has completed, then return
>> + * the result of the aio. errno will be set appropriately.
>> + */
>> +typedef ssize_t (*completion)(struct aiocb*);
>> +
>> struct aio_context {
>> int ac_read_fd, ac_write_fd;
>> long ac_seed;
>> @@ -179,6 +184,48 @@ aio_context_init(struct aio_context *ac, int read_fd,
>> ac->ac_cleanup_arg = cleanup_arg;
>> }
>>
>> +static ssize_t
>> +poll(struct aiocb *aio)
>> +{
>> + int err;
>> +
>> + while ((err = aio_error(aio)) == EINPROGRESS && !aio_timedout)
>> + usleep(25000);
>> + switch (err) {
>> + case EINPROGRESS:
>> + errno = EINTR;
>> + return (-1);
>> + case 0:
>> + return (aio_return(aio));
>> + default:
>> + return (err);
>> + }
>> +}
>> +
>
> This appears to have broken GCC builds.
>
> ===> tests/sys/aio (all)
> cc1: warnings being treated as errors
> /usr/src/tests/sys/aio/aio_test.c: In function 'poll':
> /usr/src/tests/sys/aio/aio_test.c:190: warning: declaration of 'err' shadows a global declaration
> /usr/obj/powerpc.powerpc/usr/src/tmp/usr/include/err.h:49: warning: shadowed declaration is here
> /usr/src/tests/sys/aio/aio_test.c: In function 'suspend':
> /usr/src/tests/sys/aio/aio_test.c:209: warning: declaration of 'err' shadows a global declaration
> /usr/obj/powerpc.powerpc/usr/src/tmp/usr/include/err.h:49: warning: shadowed declaration is here
>
> Glen
I think it needs an MFC of r312919 by rwatson. I'll take care of it.
-Alan
More information about the svn-src-stable-11
mailing list