File tree Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -70,6 +70,7 @@ struct io_sendzc {
70
70
unsigned flags ;
71
71
unsigned addr_len ;
72
72
void __user * addr ;
73
+ size_t done_io ;
73
74
};
74
75
75
76
#define IO_APOLL_MULTI_POLLED (REQ_F_APOLL_MULTISHOT | REQ_F_POLLED)
@@ -878,6 +879,7 @@ int io_sendzc_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
878
879
879
880
zc -> addr = u64_to_user_ptr (READ_ONCE (sqe -> addr2 ));
880
881
zc -> addr_len = READ_ONCE (sqe -> addr_len );
882
+ zc -> done_io = 0 ;
881
883
882
884
#ifdef CONFIG_COMPAT
883
885
if (req -> ctx -> compat )
@@ -1012,11 +1014,23 @@ int io_sendzc(struct io_kiocb *req, unsigned int issue_flags)
1012
1014
if (unlikely (ret < min_ret )) {
1013
1015
if (ret == - EAGAIN && (issue_flags & IO_URING_F_NONBLOCK ))
1014
1016
return - EAGAIN ;
1015
- return ret == - ERESTARTSYS ? - EINTR : ret ;
1017
+ if (ret > 0 && io_net_retry (sock , msg .msg_flags )) {
1018
+ zc -> len -= ret ;
1019
+ zc -> buf += ret ;
1020
+ zc -> done_io += ret ;
1021
+ req -> flags |= REQ_F_PARTIAL_IO ;
1022
+ return - EAGAIN ;
1023
+ }
1024
+ if (ret == - ERESTARTSYS )
1025
+ ret = - EINTR ;
1026
+ } else if (zc -> flags & IORING_RECVSEND_NOTIF_FLUSH ) {
1027
+ io_notif_slot_flush_submit (notif_slot , 0 );
1016
1028
}
1017
1029
1018
- if (zc -> flags & IORING_RECVSEND_NOTIF_FLUSH )
1019
- io_notif_slot_flush_submit (notif_slot , 0 );
1030
+ if (ret >= 0 )
1031
+ ret += zc -> done_io ;
1032
+ else if (zc -> done_io )
1033
+ ret = zc -> done_io ;
1020
1034
io_req_set_res (req , ret , 0 );
1021
1035
return IOU_OK ;
1022
1036
}
You can’t perform that action at this time.
0 commit comments