Skip to content

Commit

Permalink
windowsaio: open file for write if we have syncs
Browse files Browse the repository at this point in the history
Windows wants the file opened for write if we do a file sync, so
ensure we do that if we have syncs.

Fixes: #1352
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
axboe committed Feb 26, 2022
1 parent 78c0d7a commit c3773c1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion engines/windowsaio.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ static int fio_windowsaio_open_file(struct thread_data *td, struct fio_file *f)
log_err("fio: unknown fadvise type %d\n", td->o.fadvise_hint);
}

if (!td_write(td) || read_only)
if ((!td_write(td) && !(td->flags & TD_F_SYNCS)) || read_only)
access = GENERIC_READ;
else
access = (GENERIC_READ | GENERIC_WRITE);
Expand Down

0 comments on commit c3773c1

Please sign in to comment.