@@ -306,14 +306,11 @@ int io_remove_buffers(struct io_kiocb *req, unsigned int issue_flags)
306
306
if (!bl -> buf_nr_pages )
307
307
ret = __io_remove_buffers (ctx , bl , p -> nbufs );
308
308
}
309
+ io_ring_submit_unlock (ctx , issue_flags );
309
310
if (ret < 0 )
310
311
req_set_fail (req );
311
-
312
- /* complete before unlock, IOPOLL may need the lock */
313
312
io_req_set_res (req , ret , 0 );
314
- io_req_complete_post (req , 0 );
315
- io_ring_submit_unlock (ctx , issue_flags );
316
- return IOU_ISSUE_SKIP_COMPLETE ;
313
+ return IOU_OK ;
317
314
}
318
315
319
316
int io_provide_buffers_prep (struct io_kiocb * req , const struct io_uring_sqe * sqe )
@@ -458,13 +455,12 @@ int io_provide_buffers(struct io_kiocb *req, unsigned int issue_flags)
458
455
459
456
ret = io_add_buffers (ctx , p , bl );
460
457
err :
458
+ io_ring_submit_unlock (ctx , issue_flags );
459
+
461
460
if (ret < 0 )
462
461
req_set_fail (req );
463
- /* complete before unlock, IOPOLL may need the lock */
464
462
io_req_set_res (req , ret , 0 );
465
- io_req_complete_post (req , 0 );
466
- io_ring_submit_unlock (ctx , issue_flags );
467
- return IOU_ISSUE_SKIP_COMPLETE ;
463
+ return IOU_OK ;
468
464
}
469
465
470
466
int io_register_pbuf_ring (struct io_ring_ctx * ctx , void __user * arg )
0 commit comments