• J
    io_uring: fix sporadic double CQE entry for close · 1a417f4e
    Jens Axboe 提交于
    We punt close to async for the final fput(), but we log the completion
    even before that even in that case. We rely on the request not having
    a files table assigned to detect what the final async close should do.
    However, if we punt the async queue to __io_queue_sqe(), we'll get
    ->files assigned and this makes io_close_finish() think it should both
    close the filp again (which does no harm) AND log a new CQE event for
    this request. This causes duplicate CQEs.
    
    Queue the request up for async manually so we don't grab files
    needlessly and trigger this condition.
    Signed-off-by: NJens Axboe <axboe@kernel.dk>
    1a417f4e
io_uring.c 165.6 KB