Re: [PATCH 5.12 v3] io_uring: fix rw req completion

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 4/8/21 12:28 PM, Pavel Begunkov wrote:
> WARNING: at fs/io_uring.c:8578 io_ring_exit_work.cold+0x0/0x18
> 
> As reissuing is now passed back by REQ_F_REISSUE and kiocb_done()
> internally uses __io_complete_rw(), it may stop after setting the flag
> so leaving a dangling request.
> 
> There are tricky edge cases, e.g. reading beyound file, boundary, so
> the easiest way is to hand code reissue in kiocb_done() as
> __io_complete_rw() was doing for us before.
> 
> Fixes: 230d50d448ac ("io_uring: move reissue into regular IO path")
> Signed-off-by: Pavel Begunkov <asml.silence@xxxxxxxxx>
> Link: https://lore.kernel.org/r/f602250d292f8a84cca9a01d747744d1e797be26.1617842918.git.asml.silence@xxxxxxxxx
> Signed-off-by: Jens Axboe <axboe@xxxxxxxxx>
> ---
> 
> 
> v2: io_rw_reissue() may fail, check return code
> v3: adjust commit message
> 
>  fs/io_uring.c | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/fs/io_uring.c b/fs/io_uring.c
> index f1881ac0744b..f2df0569a60a 100644
> --- a/fs/io_uring.c
> +++ b/fs/io_uring.c
> @@ -2762,6 +2762,7 @@ static void kiocb_done(struct kiocb *kiocb, ssize_t ret,
>  {
>  	struct io_kiocb *req = container_of(kiocb, struct io_kiocb, rw.kiocb);
>  	struct io_async_rw *io = req->async_data;
> +	bool check_reissue = (kiocb->ki_complete == io_complete_rw);

I removed these unnecessary parens, and updated the patch. Thanks.

-- 
Jens Axboe




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux