summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkrisd <Kris.Davis@wdc.com>2019-05-03 08:33:50 -0500
committerkrisd <Kris.Davis@wdc.com>2019-05-30 10:00:49 -0500
commit252928cb017bcbf5e56157d15458880624af7e8a (patch)
tree4f26b35ba2575722a0015d1f3067dfaa62d5b562
parentef32da643574162c2b1aae67af38ecffb43db036 (diff)
downloadfio-252928cb017bcbf5e56157d15458880624af7e8a.tar.gz
fio-252928cb017bcbf5e56157d15458880624af7e8a.tar.bz2
Fix assert error on blktrace replay containing trims
-rw-r--r--blktrace.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/blktrace.c b/blktrace.c
index efe9ce24..8a246613 100644
--- a/blktrace.c
+++ b/blktrace.c
@@ -544,16 +544,19 @@ bool load_blktrace(struct thread_data *td, const char *filename, int need_swap)
!ios[DDIR_SYNC]) {
log_err("fio: found no ios in blktrace data\n");
return false;
- } else if (ios[DDIR_READ] && !ios[DDIR_WRITE]) {
- td->o.td_ddir = TD_DDIR_READ;
- td->o.max_bs[DDIR_READ] = rw_bs[DDIR_READ];
- } else if (!ios[DDIR_READ] && ios[DDIR_WRITE]) {
- td->o.td_ddir = TD_DDIR_WRITE;
- td->o.max_bs[DDIR_WRITE] = rw_bs[DDIR_WRITE];
- } else {
- td->o.td_ddir = TD_DDIR_RW;
+ }
+
+ td->o.td_ddir = 0;
+ if (ios[DDIR_READ]) {
+ td->o.td_ddir |= TD_DDIR_READ;
td->o.max_bs[DDIR_READ] = rw_bs[DDIR_READ];
+ }
+ if (ios[DDIR_WRITE]) {
+ td->o.td_ddir |= TD_DDIR_WRITE;
td->o.max_bs[DDIR_WRITE] = rw_bs[DDIR_WRITE];
+ }
+ if (ios[DDIR_TRIM]) {
+ td->o.td_ddir |= TD_DDIR_TRIM;
td->o.max_bs[DDIR_TRIM] = rw_bs[DDIR_TRIM];
}