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

Li Wang liwang@redhat.com
Thu Jan 2 07:31:22 CET 2020


On Thu, Jan 2, 2020 at 10:10 AM Yang Xu <xuyang2018.jy@cn.fujitsu.com>
wrote:

>
>
> Hi Li
> > To avoid FS deferred IO metadata/cache interferes test result, so we
> > do sync simply before the tst_dev_bytes_written invocation.
> >
> Looks good, acked. Also, I think we can mention it in
> doc/test-writing-guidelines.txt when using this api.
>

Ok, I will append one line as:
--- a/doc/test-writing-guidelines.txt
+++ b/doc/test-writing-guidelines.txt
@@ -1072,7 +1072,9 @@ unsigned long tst_dev_bytes_written(const char *dev);
 -------------------------------------------------------------------------------

 This function reads test block device stat file (/sys/block/<device>/stat)
and
-returns the bytes written since the last invocation of this function.
+returns the bytes written since the last invocation of this function. To
avoid
+FS deferred IO metadata/cache interferes the test result, we suggest doing
sync()
+before the tst_dev_bytes_written first invocation.

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


More information about the ltp mailing list