Skip to content

Commit

Permalink
Better accommodate random writes larger than blockalign
Browse files Browse the repository at this point in the history
fill_io_u() fails prematurely if the randomly-chosen offset satisfies
blockalign but not min_bs, i.e., the offset lies too near the end of
the target region.  This change honors both parameters.

Signed-off-by: Justin Eno <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
Justin Eno authored and axboe committed Jan 28, 2015
1 parent 209e103 commit 0412d12
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions io_u.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ static uint64_t last_block(struct thread_data *td, struct fio_file *f,
if (td->o.zone_range)
max_size = td->o.zone_range;

if (td->o.min_bs[ddir] > td->o.ba[ddir])
max_size -= td->o.min_bs[ddir] - td->o.ba[ddir];

max_blocks = max_size / (uint64_t) td->o.ba[ddir];
if (!max_blocks)
return 0;
Expand Down

0 comments on commit 0412d12

Please sign in to comment.