[LTP] [PATCH] aiodio: Remove dirty freeblocks

Cyril Hrubis
2018-09-27T12:24:32Z

Hi!
> At the beginning of the test it attempts to write some junk data to disk in
> order to increase the chance that the blocks allocated are not filled with
> zeroes.
>
> It does this by memory mapping a new file and writing 0xaa to the mapped
> memory, then syncs and unlinks the file. This uses buffered I/O which should
> not be mixed with direct I/O.

I do not follow here. Direct and buffered I/O should not be mixed for a
given file, that can lead to strange artifacts. But in this case we do
open a file, fill it with data, sync it, and then close it and we do
that before the test even starts. No direct and buffered I/O is being
mixed here or do I miss something?

> Possibly we could use direct I/O to create the dirty blocks or ensure the
> buffers have been completely flushed and any writes finalised before
> continuing. However it seems unlikely that this is either effective or
> necessary. It seems much simpler and thorough to run the test many times,
> which we do.

I do agree that the value of such function is indeed questionable but I
fail to see where is this actually hurting anything.

--
Cyril Hrubis
chrubis@suse.cz