[LTP] [PATCH COMMITTED] tst_device: do sync() before reading test block device stat file

Li Wang liwang@redhat.com
Fri Jan 3 08:24:20 CET 2020


Hi Cyril,

On Thu, Jan 2, 2020 at 8:58 PM Cyril Hrubis <chrubis@suse.cz> wrote:

> Hi!
> > To avoid FS deferred IO metadata/cache interferes test result, so we
> > do sync simply before the tst_dev_bytes_written invocation.
>
> Can we do fsync() on the fd instead of full sync()? That should be
> slightly faster.
>

Probably you miss the previous discussed [1], we use sync() here because we
do want to make sure all FS metadata/cache being written back before the
testing since there is no obtainable file descriptor 'fd' for the ext4
deferred IO (e.g. initialize the journal and inode tables).

If I was wrong here, feel free to correct me.

[1] http://lists.linux.it/pipermail/ltp/2019-December/014792.html

-- 
Regards,
Li Wang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20200103/afa5ca78/attachment.htm>


More information about the ltp mailing list