X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=filesetup.c;h=9c37ae57e24af13cc411a8f3f8398e06f5963626;hb=c465cd14ca958dfdb87bb1998add722d62ae3691;hp=3fc14641ed7d34380d5f735006eb129ab0b7faf0;hpb=d5bdff69e877a3f65928278df9d252d8881ff864;p=fio.git diff --git a/filesetup.c b/filesetup.c index 3fc14641..9c37ae57 100644 --- a/filesetup.c +++ b/filesetup.c @@ -761,12 +761,16 @@ static unsigned long long get_fs_free_counts(struct thread_data *td) uint64_t get_start_offset(struct thread_data *td, struct fio_file *f) { struct thread_options *o = &td->o; + uint64_t offset; if (o->file_append && f->filetype == FIO_TYPE_FILE) return f->real_file_size; - return td->o.start_offset + - td->subjob_number * td->o.offset_increment; + offset = td->o.start_offset + td->subjob_number * td->o.offset_increment; + if (offset % td_max_bs(td)) + offset -= (offset % td_max_bs(td)); + + return offset; } /*