When we have variable block sizes it's possible to finish a trim + write
pair and then have the next (smaller length) trim operation have a
different start offset but the same end offset as the previous pair of
trim and write operations. This would fool fio into believing that it
had already completed a trim + write pair when it actually completed
only the trim.
Resolve this problem by comparing start offsets instead of end offsets.
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
*/
if (td_randtrimwrite(td) && ddir == DDIR_TRIM &&
f->last_start[DDIR_TRIM] == io_u->offset)
- f->last_pos[DDIR_WRITE]--;
+ f->last_start[DDIR_WRITE]--;
io_u->verify_offset = io_u->offset;
return 0;
if (td_trimwrite(td)) {
struct fio_file *f = io_u->file;
- if (f->last_pos[DDIR_WRITE] == f->last_pos[DDIR_TRIM])
+ if (f->last_start[DDIR_WRITE] == f->last_start[DDIR_TRIM])
ddir = DDIR_TRIM;
else
ddir = DDIR_WRITE;