fio icon indicating copy to clipboard operation
fio copied to clipboard

fsync is not working properly with nrfiles

Open Tulsishah opened this issue 1 year ago • 1 comments

When nrfiles is set to 2 and fsync is set to 1, the sync system call is only executed after each write operation for the first file. This results in the following pattern for the first file:

Write
Sync
Write
Sync
Write
Sync

For the second file, the sync system call is not executed after each write operation.

Write
Write
Write
Flush

When nrfiles is increased to 3, the sync system call is only executed after each write operation for the first two file. The third file is not subject to any sync calls.

In summary, the sync behavior for files is determined by the value of nrfiles. When nrfiles is set to 1, all files are synced after each write operation. When nrfiles is greater than 1, only the first nrfiles-1 files are synced after each write operation.

e.g.

nrfiles=3
fsync=1
filesize=3M
bs=1M

calls for 1st file 8UFDmtBkLggvkmV

calls for 2nd file AMUwWEaqTcvhwhT

calls for 3rd file 3JCi5A8J3hYLXJg

Tulsishah avatar Nov 28 '23 08:11 Tulsishah

Is there any update on this bug?

Tulsishah avatar Dec 05 '23 05:12 Tulsishah