• P
    io_uring: fix async close() with f_op->flush() · a93b3331
    Pavel Begunkov 提交于
    First, io_close() misses filp_close() and io_cqring_add_event(), when
    f_op->flush is defined. That's because in this case it will
    io_queue_async_work() itself not grabbing files, so the corresponding
    chunk in io_close_finish() won't be executed.
    
    Second, when submitted through io_wq_submit_work(), it will do
    filp_close() and *_add_event() twice: first inline in io_close(),
    and the second one in call to io_close_finish() from io_close().
    The second one will also fire, because it was submitted async through
    generic path, and so have grabbed files.
    
    And the last nice thing is to remove this weird pilgrimage with checking
    work/old_work and casting it to nxt. Just use a helper instead.
    Signed-off-by: NPavel Begunkov <asml.silence@gmail.com>
    Signed-off-by: NJens Axboe <axboe@kernel.dk>
    a93b3331
io_uring.c 167.5 KB