->file_size is the size of the file from offset, while ->real_file_size
is the total size of the file. So when comparing EOF, we should look
at ->real_file_size against the offset.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
f->file_size = f->real_file_size;
}
f->file_size = f->real_file_size;
}
- f->file_size -= f->file_offset;
+ f->file_size = f->real_file_size - f->file_offset;
- while ((*b) * td->rw_min_bs < f->file_size) {
+ while ((*b) * td->rw_min_bs < f->real_file_size) {
if (f->file_map[i] != -1UL) {
*b += ffz(f->file_map[i]);
return 0;
if (f->file_map[i] != -1UL) {
*b += ffz(f->file_map[i]);
return 0;
b = f->last_pos / td->min_bs[ddir];
*offset = (b * td->min_bs[ddir]) + f->file_offset;
b = f->last_pos / td->min_bs[ddir];
*offset = (b * td->min_bs[ddir]) + f->file_offset;
- if (*offset > f->file_size)
+ if (*offset > f->real_file_size)
- if (io_u->buflen + io_u->offset > f->file_size) {
+ if (io_u->buflen + io_u->offset > f->real_file_size) {
if (td->io_ops->flags & FIO_RAWIO) {
put_io_u(td, io_u);
return NULL;
}
if (td->io_ops->flags & FIO_RAWIO) {
put_io_u(td, io_u);
return NULL;
}
- io_u->buflen = f->file_size - io_u->offset;
+ io_u->buflen = f->real_file_size - io_u->offset;
}
if (io_u->ddir != DDIR_SYNC) {
}
if (io_u->ddir != DDIR_SYNC) {