Re: [PATCH 24/31] aio: remove an outdated comment in aio_complete

From: Jeff Moyer
Date: Tue Jan 09 2018 - 12:19:52 EST


Christoph Hellwig <hch@xxxxxx> writes:

> These days we don't treat sync iocbs special in the aio completion code as
> they never use it. Remove the old comment, and move the BUG_ON for a sync
> iocb to the top of the function.
>
> Signed-off-by: Christoph Hellwig <hch@xxxxxx>

Right, this should have been part of commit 599bd19bdc4c6 ("fs: don't
allow to complete sync iocbs through aio_complete").

Reviewed-by: Jeff Moyer <jmoyer@xxxxxxxxxx>


> ---
> fs/aio.c | 11 ++---------
> 1 file changed, 2 insertions(+), 9 deletions(-)
>
> diff --git a/fs/aio.c b/fs/aio.c
> index 03d59593912d..41fc8ce6bc7f 100644
> --- a/fs/aio.c
> +++ b/fs/aio.c
> @@ -1088,6 +1088,8 @@ static void aio_complete(struct kiocb *kiocb, long res, long res2)
> unsigned tail, pos, head;
> unsigned long flags;
>
> + BUG_ON(is_sync_kiocb(kiocb));
> +
> if (kiocb->ki_flags & IOCB_WRITE) {
> struct file *file = kiocb->ki_filp;
>
> @@ -1100,15 +1102,6 @@ static void aio_complete(struct kiocb *kiocb, long res, long res2)
> file_end_write(file);
> }
>
> - /*
> - * Special case handling for sync iocbs:
> - * - events go directly into the iocb for fast handling
> - * - the sync task with the iocb in its stack holds the single iocb
> - * ref, no other paths have a way to get another ref
> - * - the sync task helpfully left a reference to itself in the iocb
> - */
> - BUG_ON(is_sync_kiocb(kiocb));
> -
> if (iocb->ki_list.next) {
> unsigned long flags;