log_err("fio: bug in offset generation: offset=%llu, b=%llu\n", (unsigned long long) offset, (unsigned long long) b);
ret = 1;
}
+ io_u->verify_offset = io_u->offset;
}
return ret;
return 1;
}
+ io_u->verify_offset = io_u->offset;
return 0;
}
if (td->o.io_submit_mode == IO_MODE_INLINE)
io_u_quiesce(td);
+ if (td->o.timeout && ((usec + now) > td->o.timeout)) {
+ /*
+ * check if the usec is capable of taking negative values
+ */
+ if (now > td->o.timeout) {
+ ddir = DDIR_INVAL;
+ return ddir;
+ }
+ usec = td->o.timeout - now;
+ }
usec_sleep(td, usec);
+
+ now = utime_since_now(&td->epoch);
+ if ((td->o.timeout && (now > td->o.timeout)) || td->terminate)
+ ddir = DDIR_INVAL;
+
return ddir;
}
{
const bool needs_lock = td_async_processing(td);
- zbd_put_io_u(io_u);
+ zbd_put_io_u(td, io_u);
if (td->parent)
td = td->parent;
set_rw_ddir(td, io_u);
+ if (io_u->ddir == DDIR_INVAL) {
+ dprint(FD_IO, "invalid direction received ddir = %d", io_u->ddir);
+ return 1;
+ }
/*
* fsync() or fdatasync() or trim etc, we are done
*/
out:
dprint_io_u(io_u, "fill");
+ io_u->verify_offset = io_u->offset;
td->zone_bytes += io_u->buflen;
return 0;
}
break;
case 1 ... 4:
idx = 1;
+ fallthrough;
case 0:
break;
}
break;
case 2 ... 3:
idx = 1;
+ fallthrough;
case 1:
break;
}
break;
case 2 ... 3:
idx = 1;
+ fallthrough;
case 0 ... 1:
break;
}
break;
case 2 ... 3:
idx = 1;
+ fallthrough;
case 0 ... 1:
break;
}
break;
case 2 ... 3:
idx = 1;
+ fallthrough;
case 0 ... 1:
break;
}
if (!fill_io_u(td, io_u))
break;
- zbd_put_io_u(io_u);
+ zbd_put_io_u(td, io_u);
put_file_log(td, f);
td_io_close_file(td, f);
__td_io_u_lock(td);
again:
- if (!io_u_rempty(&td->io_u_requeues))
+ if (!io_u_rempty(&td->io_u_requeues)) {
io_u = io_u_rpop(&td->io_u_requeues);
- else if (!queue_full(td)) {
+ io_u->resid = 0;
+ } else if (!queue_full(td)) {
io_u = io_u_qpop(&td->io_u_freelist);
io_u->file = NULL;
if (io_u->error)
unlog_io_piece(td, io_u);
else {
- io_u->ipo->flags &= ~IP_F_IN_FLIGHT;
- write_barrier();
+ atomic_store_release(&io_u->ipo->flags,
+ io_u->ipo->flags & ~IP_F_IN_FLIGHT);
}
}
td->last_ddir = ddir;
if (!io_u->error && ddir_rw(ddir)) {
- unsigned long long bytes = io_u->buflen - io_u->resid;
+ unsigned long long bytes = io_u->xfer_buflen - io_u->resid;
int ret;
+ /*
+ * Make sure we notice short IO from here, and requeue them
+ * appropriately!
+ */
+ if (io_u->resid) {
+ io_u->xfer_buflen = io_u->resid;
+ io_u->xfer_buf += bytes;
+ io_u->offset += bytes;
+ td->ts.short_io_u[io_u->ddir]++;
+ if (io_u->offset < io_u->file->real_file_size) {
+ requeue_io_u(td, io_u_ptr);
+ return;
+ }
+ }
+
td->io_blocks[ddir]++;
td->io_bytes[ddir] += bytes;