File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -880,7 +880,15 @@ static int __io_read(struct io_kiocb *req, unsigned int issue_flags)
880
880
if (unlikely (ret ))
881
881
return ret ;
882
882
883
- ret = io_iter_do_read (rw , & io -> iter );
883
+ if (unlikely (req -> opcode == IORING_OP_READ_MULTISHOT )) {
884
+ void * cb_copy = rw -> kiocb .ki_complete ;
885
+
886
+ rw -> kiocb .ki_complete = NULL ;
887
+ ret = io_iter_do_read (rw , & io -> iter );
888
+ rw -> kiocb .ki_complete = cb_copy ;
889
+ } else {
890
+ ret = io_iter_do_read (rw , & io -> iter );
891
+ }
884
892
885
893
/*
886
894
* Some file systems like to return -EOPNOTSUPP for an IOCB_NOWAIT
@@ -904,7 +912,8 @@ static int __io_read(struct io_kiocb *req, unsigned int issue_flags)
904
912
} else if (ret == - EIOCBQUEUED ) {
905
913
return IOU_ISSUE_SKIP_COMPLETE ;
906
914
} else if (ret == req -> cqe .res || ret <= 0 || !force_nonblock ||
907
- (req -> flags & REQ_F_NOWAIT ) || !need_complete_io (req )) {
915
+ (req -> flags & REQ_F_NOWAIT ) || !need_complete_io (req ) ||
916
+ (issue_flags & IO_URING_F_MULTISHOT )) {
908
917
/* read all, failed, already did sync or don't want to retry */
909
918
goto done ;
910
919
}
You can’t perform that action at this time.
0 commit comments