axboe / fio

Flexible I/O Tester
GNU General Public License v2.0
5.21k stars 1.26k forks source link

For nfs engine, treat randwrite the same as write when opening file #1775

Closed panxiao2014 closed 3 months ago

panxiao2014 commented 3 months ago

When use nfs engine, only write mode can work if file doesn't exist before test starts. This code change just made randwrite behaves the same as write. So both write and randwrite could work in scenario where file doesn't exist before test start.

Note: other than write and randwrite mode, nfs engine would report error when test start. This is because fio would not layout the file before test start. This also indicate that currently nfs engine requires user to make sure files are ready before test when choose mode such as read, randread and readwrite.

This requires more code changes. So now just add one line code change to let randwrite can work.

panxiao2014 commented 3 months ago

Hi @vincentkfu , I saw there is an error when checking build on cygwin platform: multiple definition of `strtoll' found. I did not touch this part of code. Could you please check if there is additional task that I should do before submitting PR?

Thanks.

vincentkfu commented 3 months ago

That failure is due to changes in an external library and unrelated to your changes.

panxiao2014 commented 3 months ago

Thanks Vincent. We are using fio for our NFS server test. The change here could make our test script automation works easier. Please help to check if this code change could be promoted.

panxiao2014 commented 3 months ago

Thanks Jens. I have updated the code change and run some test to verify it. Please review.

axboe commented 3 months ago

Looks fine, but please squash that into one commit. It's a bit pointless to have a suboptimal fix, and then a fixup on top.