In case of write, the iov_iter gets updated before retry kicks in. Restore the iov_iter before retrying. It can be reproduced by issuing a write greater than device limit. Fixes: df604d2ad480 (io_uring/rw: ensure retry condition isn't lost) Signed-off-by: Anuj Gupta <anuj20.g@xxxxxxxxxxx> --- io_uring/rw.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/io_uring/rw.c b/io_uring/rw.c index 4fed829fe97c..9fadb29ec34f 100644 --- a/io_uring/rw.c +++ b/io_uring/rw.c @@ -1035,8 +1035,10 @@ int io_write(struct io_kiocb *req, unsigned int issue_flags) else ret2 = -EINVAL; - if (req->flags & REQ_F_REISSUE) + if (req->flags & REQ_F_REISSUE) { + iov_iter_restore(&io->iter, &io->iter_state); return IOU_ISSUE_SKIP_COMPLETE; + } /* * Raw bdev writes will return -EOPNOTSUPP for IOCB_NOWAIT. Just -- 2.25.1