File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -533,6 +533,14 @@ static bool io_poll_can_finish_inline(struct io_kiocb *req,
533533 return pt -> owning || io_poll_get_ownership (req );
534534}
535535
536+ static void io_poll_add_hash (struct io_kiocb * req )
537+ {
538+ if (req -> flags & REQ_F_HASH_LOCKED )
539+ io_poll_req_insert_locked (req );
540+ else
541+ io_poll_req_insert (req );
542+ }
543+
536544/*
537545 * Returns 0 when it's handed over for polling. The caller owns the requests if
538546 * it returns non-zero, but otherwise should not touch it. Negative values
@@ -591,18 +599,17 @@ static int __io_arm_poll_handler(struct io_kiocb *req,
591599
592600 if (mask &&
593601 ((poll -> events & (EPOLLET |EPOLLONESHOT )) == (EPOLLET |EPOLLONESHOT ))) {
594- if (!io_poll_can_finish_inline (req , ipt ))
602+ if (!io_poll_can_finish_inline (req , ipt )) {
603+ io_poll_add_hash (req );
595604 return 0 ;
605+ }
596606 io_poll_remove_entries (req );
597607 ipt -> result_mask = mask ;
598608 /* no one else has access to the req, forget about the ref */
599609 return 1 ;
600610 }
601611
602- if (req -> flags & REQ_F_HASH_LOCKED )
603- io_poll_req_insert_locked (req );
604- else
605- io_poll_req_insert (req );
612+ io_poll_add_hash (req );
606613
607614 if (mask && (poll -> events & EPOLLET ) &&
608615 io_poll_can_finish_inline (req , ipt )) {
You can’t perform that action at this time.
0 commit comments