Date: Fri, 2 Jun 2017 12:50:01 +0000 From: Glen Barber <gjb@FreeBSD.org> To: Ngie Cooper <ngie@FreeBSD.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: Re: svn commit: r319173 - stable/11/tests/sys/aio Message-ID: <20170602125001.GA44390@FreeBSD.org> In-Reply-To: <201705300309.v4U3911t053281@repo.freebsd.org> References: <201705300309.v4U3911t053281@repo.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--lrZ03NoBR/3+SXJZ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 >=20 > Log: > MFC r312913,r318100,r318107: > =20 > r312913 (by asomers): > =20 > Improve the aio tests > =20 > * Add tests for aio_suspend(2). > * Add tests for polled completion notification. > * Test the full matrix of file descriptor types and completion notifica= tion > mechanisms. > * Don't bother with mkstemp, because ATF runs every test in its own tem= p dir. > * Fix some typos. > * Remove extraneous ATF_REQUIRE_KERNEL_MODULE calls. > =20 > r318100: > =20 > style(9): move function definition curly braces to column 0 > =20 > r318107: > =20 > Remove unused constant (PATH_TEMPLATE) > =20 > It was made unnecessary in r312913. > =20 > MFC with: r312913 >=20 > Modified: > stable/11/tests/sys/aio/aio_test.c > Directory Properties: > stable/11/ (props changed) >=20 > Modified: stable/11/tests/sys/aio/aio_test.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- 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 exe= rcise > + * initiated to detect undue blocking. This test does not attempt to ex= ercise > * 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" > =20 > -#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 defa= ult > @@ -74,6 +72,13 @@ > #define GLOBAL_MAX 16384 > =20 > #define BUFFER_MAX GLOBAL_MAX > + > +/* > + * A completion function will block until the aio has completed, then re= turn > + * 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 =3D cleanup_arg; > } > =20 > +static ssize_t > +poll(struct aiocb *aio) > +{ > + int err; > + > + while ((err =3D aio_error(aio)) =3D=3D EINPROGRESS && !aio_timedout) > + usleep(25000); > + switch (err) { > + case EINPROGRESS: > + errno =3D EINTR; > + return (-1); > + case 0: > + return (aio_return(aio)); > + default: > + return (err); > + } > +} > + This appears to have broken GCC builds. =3D=3D=3D> 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' shado= ws a global declaration /usr/obj/powerpc.powerpc/usr/src/tmp/usr/include/err.h:49: warning: shadow= ed 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' shado= ws a global declaration /usr/obj/powerpc.powerpc/usr/src/tmp/usr/include/err.h:49: warning: shadow= ed declaration is here Glen --lrZ03NoBR/3+SXJZ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEjRJAPC5sqwhs9k2jAxRYpUeP4pMFAlkxXvMACgkQAxRYpUeP 4pO9rw/+IknAruVUyAsqj8eAL0fR/jqSeZIVNZOmzdRbAelf2nQmNylISRgeh7zC D60HHbjIM8aMCoOCI1wbk5wvaANIcpURXfLXa0Mdo98qScCABhvLrVLz6gYDXSQh qwYx4Qiz4hpKgbcUw47iomMOneJ13m70QYNNXSUD/xnsWXEZJ9ebCtoshGQHBzDg wiT9rPwRLiyk5nOJtPnbbxV3Qap4MCax0/BSO9AFYQRufrCfXroNANOdggnR7Pd/ 01cfEfYVZX5crx5RZ+HajUHXjsIg1Pz6E5Sqsd8ozD8ColX1Vn7y3HBvm+CJnpm4 jxBBxeXiQoy+VzbdAgUpSFN2XSYuNuPdVhFPoY6Ibxyc3cWVUC0ansEiEpqJLF6H iBjHhGXJ/KIErOwcj/lUlbnGnmUd46rCk16Pa2wS8biv67bsFdzKOXII4v3nqC8r qO9TthRnnNcb/4tOsLrynBICaertj70h/Gx92fmidAsBoIP7y1G8UEap7wqwLPSl kG8wSkdS+9BL048zBOI2kN87vrz5VtjvAvl6vODaHlUuk9Bx0vuHQBLbystxWTrq 3dN78VdRGKg8/wIAnHVHxAQ5RQGOgYVvvvqDcqIaA1lbzNiqqbVa+DRz07+NROk0 z1U3pfuGKsI59He0Pm0PchU1iVyU1lIROH8fxDDbOFNriqaEsu0= =B09r -----END PGP SIGNATURE----- --lrZ03NoBR/3+SXJZ--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20170602125001.GA44390>