Skip to content

Commit

Permalink
io_u: Support fsync for --rw=trimwrite
Browse files Browse the repository at this point in the history
Even if ddir is determined in get_rw_ddir(), ddir might be updated in
set_rw_ddir().  if td represents trimwrite, it will be updated to either
DDIR_TRIM or DDIR_WRITE even ddir already represents for DDIR_SYNC.

To support DDIR_SYNC(fsync) for trimwrite, this patch checks ddir_sync()
in case of trimwrite not to update the pre-determined ddir.

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
  • Loading branch information
minwooim committed Jul 11, 2024
1 parent 704a8cf commit cf168c5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion io_u.c
Original file line number Diff line number Diff line change
Expand Up @@ -815,7 +815,7 @@ static void set_rw_ddir(struct thread_data *td, struct io_u *io_u)
if (td->o.zone_mode == ZONE_MODE_ZBD)
ddir = zbd_adjust_ddir(td, io_u, ddir);

if (td_trimwrite(td)) {
if (td_trimwrite(td) && !ddir_sync(ddir)) {
struct fio_file *f = io_u->file;
if (f->last_start[DDIR_WRITE] == f->last_start[DDIR_TRIM])
ddir = DDIR_TRIM;
Expand Down

0 comments on commit cf168c5

Please sign in to comment.