On 11/20/2019 5:22 PM, Jens Axboe wrote: >> However, this is only true if linked timeout isn't fired. Otherwise, >> there is another bug, which isn't fixed by either of the patches. We >> need to clear REQ_F_LINK_TIMEOUT in io_link_timeout_fn() as well. >> >> Let: REQ -> L_TIMEOUT1 -> L_TIMEOUT2 >> 1. L_TIMEOUT1 fired before REQ is completed >> >> 2. io_link_timeout_fn() removes L_TIMEOUT1 from the list: >> REQ|REQ_F_LINK_TIMEOUT -> L_TIMEOUT2 >> >> 3. free_req(REQ) then call io_link_cancel_timeout(L_TIMEOUT2) >> leaking it (as described in my patch). >> >> P.S. haven't tried to test nor reproduce it yet. > > That's exactly the case I was worried about. In any case, it seems > prudent to handle it defensively. > Yeah, I've got from the patch that may have missed something. Will you add this "should clear REQ_F_LINK_TIMEOUT in io_link_timeout_fn()" (e.g. in v2), or should I? -- Pavel Begunkov