Explicitly check td_trim(td) for the direction of next io_u
[fio.git] / io_u.c
diff --git a/io_u.c b/io_u.c
index f1a3916f5096ea7cc07be1c488b42f32307fc83d..69bec4bf4bcf83d57d1edf40e63c0a34f912bd02 100644 (file)
--- a/io_u.c
+++ b/io_u.c
@@ -758,8 +758,10 @@ static enum fio_ddir get_rw_ddir(struct thread_data *td)
                ddir = DDIR_READ;
        else if (td_write(td))
                ddir = DDIR_WRITE;
                ddir = DDIR_READ;
        else if (td_write(td))
                ddir = DDIR_WRITE;
-       else
+       else if (td_trim(td))
                ddir = DDIR_TRIM;
                ddir = DDIR_TRIM;
+       else
+               ddir = DDIR_INVAL;
 
        td->rwmix_ddir = rate_ddir(td, ddir);
        return td->rwmix_ddir;
 
        td->rwmix_ddir = rate_ddir(td, ddir);
        return td->rwmix_ddir;