dedupe_percentage should work even if compress_percentage is not set
authorVasily Tarasov <tarasov@vasily.name>
Wed, 28 Jan 2015 16:10:30 +0000 (09:10 -0700)
committerJens Axboe <axboe@fb.com>
Wed, 28 Jan 2015 16:10:30 +0000 (09:10 -0700)
commit4eff3e579280ca5a5416ffb7fa106791aa23d6ef
treeb4c8edf902aa611f91276eb9f34ec305c1b8b0b1
parent0412d12e12957a90d63b802a4069ca91c3feed58
dedupe_percentage should work even if compress_percentage is not set

Currently dedupe_percentage option does not work properly if
compress_percentage is not set. This can be easily demonstrated using
the following job file:

[job-/dev/dm-0]
filename=/dev/dm-0
rw=randwrite
blocksize=4096
direct=1
ioengine=libaio
iodepth=32
dedupe_percentage=50
time_based=1
runtime=5
numjobs=1

All writes will contain zeroes for the above job file.

The problem is in fill_io_buffer() function that switches dedupe random
state only if o->compress_percentage is set.

This patch updates the condition appropriately in fill_io_buffer()
appropriately.

Signed-off-by: Vasily Tarasov <tarasov@vasily.name>
Signed-off-by: Jens Axboe <axboe@fb.com>
io_u.c