• zhangyi (F)'s avatar
    io_uring: correct timeout req sequence when inserting a new entry · a1f58ba4
    zhangyi (F) authored
    The sequence number of the timeout req (req->sequence) indicate the
    expected completion request. Because of each timeout req consume a
    sequence number, so the sequence of each timeout req on the timeout
    list shouldn't be the same. But now, we may get the same number (also
    incorrect) if we insert a new entry before the last one, such as submit
    such two timeout reqs on a new ring instance below.
    
                        req->sequence
     req_1 (count = 2):       2
     req_2 (count = 1):       2
    
    Then, if we submit a nop req, req_2 will still timeout even the nop req
    finished. This patch fix this problem by adjust the sequence number of
    each reordered reqs when inserting a new entry.
    Signed-off-by: default avatarzhangyi (F) <yi.zhang@huawei.com>
    Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
    a1f58ba4
io_uring.c 94.7 KB