Skip to content

Commit

Permalink
io_u: calculate incremental residuals correctly
Browse files Browse the repository at this point in the history
We need to use the transfer buffer length for the residual calculation,
otherwise multiple shorts on the same IO will not calculate the right
value.

Fixes: 5fff954 ("Add support for >= 4G block sizes")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
axboe committed Aug 12, 2020
1 parent 0d57808 commit 84abeef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion io_u.c
Expand Up @@ -1977,7 +1977,7 @@ static void io_completed(struct thread_data *td, struct io_u **io_u_ptr,
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;

/*
Expand Down

0 comments on commit 84abeef

Please sign in to comment.