[LTP] [PATCH] io_submit01/io_submit02: Bugfix for running with the option "-i"

Martin Doucha mdoucha@suse.cz
Fri Apr 8 18:36:09 CEST 2022


On 05. 04. 22 16:07, Petr Vorel wrote:
> Hi all,
> 
>> For io_submit01, add io_destroy before test return, or the test
>> would fail and report EAGAIN.
>> For io_submit02, move the io_destroy to the suitable location, or
>> the test would fail and report EAGAIN.
> 
> $ ./io_submit01 -i150
> ...
> io_submit01.c:122: TPASS: io_submit() with NULL iocb pointers failed with EFAULT
> io_submit01.c:127: TFAIL: io_submit() returned -11(EAGAIN/EWOULDBLOCK), expected EBADF(-9)
> io_submit01.c:127: TFAIL: io_submit() returned -11(EAGAIN/EWOULDBLOCK), expected EBADF(-9)
> io_submit01.c:127: TFAIL: io_submit() returned -11(EAGAIN/EWOULDBLOCK), expected EBADF(-9)
> io_submit01.c:127: TFAIL: io_submit() returned -11(EAGAIN/EWOULDBLOCK), expected SUCCESS(1)
> 
> $ ./io_submit02 -i150
> ...
> io_submit02.c:76: TPASS: io_submit() returns 0 if nr is zero
> io_submit02.c:78: TFAIL: io_submit() returns -1, expected 1
> 
> @Cyril, Li, Martin, Viresh: while this fix is valid using memset() (which is required)
> slows down testing a lot. Any idea whether this can be avoid to keep the speed?

It's slow because the "fix" keeps destroying and recreating the IO
context. You don't need to do that, you just need to flush the finished
events from kernel buffer using io_getevents(), otherwise it'll get full
and io_submit() will start returning EAGAIN. I'll submit a patch on Monday.

-- 
Martin Doucha   mdoucha@suse.cz
QA Engineer for Software Maintenance
SUSE LINUX, s.r.o.
CORSO IIa
Krizikova 148/34
186 00 Prague 8
Czech Republic


More information about the ltp mailing list