[LTP] [PATCH v6] Refactor aiocp using new LTP API

Cyril Hrubis chrubis@suse.cz
Thu Aug 11 12:25:07 CEST 2022


Hi!
> > I guess that we can do a little trick such as making the buffer with
> > random data slightly bigger and choosing a random start offset in that
> > etc.
> 
> I tested Andreas patches from v2 to v6 and aiocp with -f DIRECT works only on
> btrfs. Running on $TMPDIR being on ext4, xfs, tmpfs endup with EINVAL:
> 
> # ./aiocp -b 1k -n 1 -f DIRECT
> aiocp.c:240: TINFO: Maximum AIO blocks: 65536
> aiocp.c:265: TINFO: Fill srcfile.bin with random data
> aiocp.c:267: TBROK: open(srcfile.bin,16450,0666) failed: EINVAL (22)
> 
> Any idea what could be wrong?

There are couple of things wrong in there actually. First of all when
the file is prepared in the test setup the flags passed on the
commandline shouldn't be used at all, since the buffer in the function
that fills the file with random data is not aligned at all.

Secondly looking at the flags in the failing open we seem to pass O_RDWR
so my guess would be that O_DIRECT is supported only for O_RDONLY or
O_WRONLY file descriptors.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list