Re: [PATCH v2 2/2] test/timeout-swallow: verify -ETIME is not swallowed
Jens Axboe <[email protected]> Tue, 14 Jul 2026 12:12:24 -0600
| Newsgroups | org.kernel.vger.io-uring |
|---|---|
| Message-ID | <[email protected]> |
On 7/14/26 10:57 AM, Prateek wrote: > Signed-off-by: Prateek <[email protected]> > Reviewed-by: Gabriel Krisman Bertazi <[email protected]> > Signed-off-by: Prateek <[email protected]> Similar for both, don't add 2 signed-off-by lines. > diff --git a/test/timeout-swallow.c b/test/timeout-swallow.c > new file mode 100644 > index 00000000..d08365da > --- /dev/null > +++ b/test/timeout-swallow.c > @@ -0,0 +1,117 @@ > +/* SPDX-License-Identifier: MIT */ > +/* > + * Description: tests that io_uring_wait_cqes() and variants do not swallow > + * -ETIME when loop-fetching CQEs if some SQEs were submitted. > + */ > +#include <stdio.h> > +#include <unistd.h> > +#include <errno.h> > +#include <sys/time.h> > +#include "liburing.h" > +#include "helpers.h" > + > +/* > + * Test the normal -ETIME swallow path. > + */ > +static int test_timeout(struct io_uring *ring) > +{ > + struct io_uring_sqe *sqe; > + struct io_uring_cqe *cqe; > + struct __kernel_timespec long_ts = { .tv_sec = 10, .tv_nsec = 0 }; > + struct __kernel_timespec zero_ts = { .tv_sec = 0, .tv_nsec = 0 }; > + int ret; Bad style in this file, all over. Tabs are tabs, not some random amount of spaces. Follow the style of code around you rather than just use your own. And watch for trailing whitespace, you have a that in multiple spots. > + /* Long timeout, won't complete immediately */ > + io_uring_prep_timeout(sqe, &long_ts, 1, 0); > + Like the line below the prep here, trailing whitespace. -- Jens Axboe