Skip to content

Commit 97a91b6

Browse files
committed
Merge branch 'fix/io_uring-pi-validate' of https://github.com/stanleyzhang9/fio
* 'fix/io_uring-pi-validate' of https://github.com/stanleyzhang9/fio: engines/io_uring: validate PI on read
2 parents cda2257 + 72fb5b5 commit 97a91b6

File tree

1 file changed

+9
-14
lines changed

1 file changed

+9
-14
lines changed

engines/io_uring.c

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -686,24 +686,19 @@ static struct io_u *fio_ioring_event(struct thread_data *td, int event)
686686
if (cqe->res == io_u->xfer_buflen ||
687687
(io_u->ddir == DDIR_TRIM && !cqe->res)) {
688688
io_u->error = 0;
689+
if (io_u->ddir == DDIR_READ && o->md_per_io_size && !o->pi_act)
690+
fio_ioring_validate_md(td, io_u);
689691
return io_u;
690692
}
691693

692-
if (cqe->res != io_u->xfer_buflen) {
693-
if (io_u->ddir == DDIR_TRIM) {
694-
ld->async_trim_fail = 1;
695-
cqe->res = 0;
696-
}
697-
if (cqe->res > io_u->xfer_buflen)
698-
io_u->error = -cqe->res;
699-
else
700-
io_u->resid = io_u->xfer_buflen - cqe->res;
701-
702-
return io_u;
694+
if (io_u->ddir == DDIR_TRIM) {
695+
ld->async_trim_fail = 1;
696+
cqe->res = 0;
703697
}
704-
705-
if (o->md_per_io_size)
706-
fio_ioring_validate_md(td, io_u);
698+
if (cqe->res > io_u->xfer_buflen)
699+
io_u->error = -cqe->res;
700+
else
701+
io_u->resid = io_u->xfer_buflen - cqe->res;
707702

708703
return io_u;
709704
}

0 commit comments

Comments
 (0)