Async IO engines need to signal residual from the completion path,
but we completely ignore those. Ensure we properly requeue IO that
was short, after adjusting the state.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
unsigned long long bytes = io_u->buflen - io_u->resid;
int ret;
unsigned long long bytes = io_u->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;
td->io_blocks[ddir]++;
td->io_bytes[ddir] += bytes;