summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@fb.com>2017-05-04 08:43:27 -0600
committerJens Axboe <axboe@fb.com>2017-05-04 08:43:27 -0600
commitc55fae03f7d5c0981e55241fc9003d762f7a5fd9 (patch)
tree2c5beefc665efb7a36830855eb65b69122046c12
parentf52e919826839eaba90903b67fe02042159a0023 (diff)
downloadfio-c55fae03f7d5c0981e55241fc9003d762f7a5fd9.tar.gz
fio-c55fae03f7d5c0981e55241fc9003d762f7a5fd9.tar.bz2
options: force refill_buffers with pattern and any reads
This will cause writes to always refill the buffer, which is needed to avoid having the reads garble the contents. Signed-off-by: Jens Axboe <axboe@fb.com>
-rw-r--r--options.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/options.c b/options.c
index 85574d7f..b489e902 100644
--- a/options.c
+++ b/options.c
@@ -1306,8 +1306,17 @@ static int str_buffer_pattern_cb(void *data, const char *input)
assert(ret != 0);
td->o.buffer_pattern_bytes = ret;
- if (!td->o.compress_percentage)
+
+ /*
+ * If this job is doing any reading or has compression set,
+ * ensure that we refill buffers for writes or we could be
+ * invalidating the pattern through reads.
+ */
+ if (!td->o.compress_percentage && !td_read(td))
td->o.refill_buffers = 0;
+ else
+ td->o.refill_buffers = 1;
+
td->o.scramble_buffers = 0;
td->o.zero_buffers = 0;