[LTP] [PATCH] aio-stress: fix opened fd leak

Cyril Hrubis chrubis@suse.cz
Thu Jan 16 17:12:22 CET 2025


Hi!
> > > In cases where worker completes specified number of `iterations` before
> > > oper completes all `total_ios`, such oper remains on active_list.
> > > This is a problem because cleanup only walks over finished list,
> > > and closes fds only for items on this list. So it's possible for
> > > test to exhaust ulimit for open files and fail:
> > >
> > > $ ./aio-stress -a1 -I100 -o2 -r4 -f1 -d1^
> > > aio-stress.c:1347: TPASS: Test passed
> > > aio-stress.c:1285: TINFO: starting with random write
> > > aio-stress.c:1296: TINFO: file size 1024MB, record size 0KB, depth 1, I/O per iteration 1
> > > aio-stress.c:1298: TINFO: max io_submit 1, buffer alignment set to 4KB
> > > aio-stress.c:1300: TINFO: threads 1 files 1 contexts 1 context offset 2MB verification off
> > > aio-stress.c:1314: TBROK: open(file0.bin,1052738,0600) failed: EMFILE (24)
> >
> > Looks like the test has many options and some combinations may set
> > things in a way that does not make much sense.
> 
> I think the options I saw in failures were defaults, the "-a1" above I
> added to reproduce it faster.

That's entirely possible, given how complex the options for the test
are and how they are connected to each other. I guess that we can try to
figure out how they are working together given enough time and large
enough piece of paper, however I'm not going to have a time for that
before we stabilize LTP for the January release.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list