<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jan 2, 2020 at 2:46 PM Yang Xu <<a href="mailto:xuyang2018.jy@cn.fujitsu.com">xuyang2018.jy@cn.fujitsu.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
<br>
on 2020/01/02 14:31, Li Wang wrote:<br>
> <br>
> <br>
> On Thu, Jan 2, 2020 at 10:10 AM Yang Xu <<a href="mailto:xuyang2018.jy@cn.fujitsu.com" target="_blank">xuyang2018.jy@cn.fujitsu.com</a> <br>
> <mailto:<a href="mailto:xuyang2018.jy@cn.fujitsu.com" target="_blank">xuyang2018.jy@cn.fujitsu.com</a>>> wrote:<br>
> <br>
> <br>
> <br>
> Hi Li<br>
> > To avoid FS deferred IO metadata/cache interferes test result, so we<br>
> > do sync simply before the tst_dev_bytes_written invocation.<br>
> ><br>
> Looks good, acked. Also, I think we can mention it in<br>
> doc/test-writing-guidelines.txt when using this api.<br>
> <br>
> <br>
> Ok, I will append one line as:<br>
> --- a/doc/test-writing-guidelines.txt<br>
> +++ b/doc/test-writing-guidelines.txt<br>
> @@ -1072,7 +1072,9 @@ unsigned long tst_dev_bytes_written(const char *dev);<br>
> -------------------------------------------------------------------------------<br>
> <br>
> This function reads test block device stat file <br>
> (/sys/block/<device>/stat) and<br>
> -returns the bytes written since the last invocation of this function.<br>
> +returns the bytes written since the last invocation of this function. <br>
> To avoid<br>
> +FS deferred IO metadata/cache interferes the test result, we suggest <br>
> doing sync()<br>
> +before the tst_dev_bytes_written first invocation.<br>
OK.<br>
<br>
I also meet another problem when using this api on old kernel.<br>
<br>
tst_device.c:395: CONF: Test device stat file: /sys/block/loop0/stat broken<br>
<br>
/sys/block/loop0/stat is all 0 and case reports TCONF. on new kernel,<br>
this value is normal. This is a block layer or loop device driver <br>
modifition several yeas ago?<br></blockquote><div><br></div><div class="gmail_default" style="font-size:small">It sounds like a kernel issue, can you tell which kernel version you did test?</div><div class="gmail_default" style="font-size:small"></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
ps:I know ltp used LOOP_SET_FD to make loop device simulate other <br>
filesystems. I am trying to find a generic way about this api.<br>
<br>
Best Regards<br>
Yang Xu<br>
> <br>
> -- <br>
> Regards,<br>
> Li Wang<br>
<br>
<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Regards,<br></div><div>Li Wang<br></div></div></div></div>