[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-aio
Subject:    Re: [PATCH v2] aio: io_cancel(): don't always return -EINVAL
From:       Jeff Moyer <jmoyer () redhat ! com>
Date:       2020-01-27 14:51:38
Message-ID: x49eevlx891.fsf () segfault ! boston ! devel ! redhat ! com
[Download RAW message or body]

mwilck@suse.com writes:

> From: Martin Wilck <mwilck@suse.com>
>
> Since commit 0460fef2a921 ("aio: use cancellation list lazily"),
> sys_io_cancel() basically always returns -EINVAL, because only such iocbs
> that have a ki_cancel attribute are members of the active list, and hardl=
y
> any iocbs have this attribute. This is confusing, because according to th=
e
> man page -EINVAL means that the passed-in aio context is invalid.
>
> Change this to -EAGAIN, which according to the man page means "The iocb
> specified was not cancelled". Using -EAGAIN might wrongly suggest to user=
s
> that repeating the system call might succeed, but it seems to be more
> fitting than -EINVAL.
>
> While at it, fix the comments for sys_io_cancel().
>
> Fixes: 0460fef2a921 ("aio: use cancellation list lazily")
> Signed-off-by: Martin Wilck <mwilck@suse.com>
> Reviewed-by: Hannes Reinecke <hare@suse.de>
> ---
> v2: Improved kernel-doc formatting of Results section.
>     Added "Fixes" tag; minor enhancements of commit description.

Reviewed-by: Jeff Moyer <jmoyer@redhat.com>


--
To unsubscribe, send a message with 'unsubscribe linux-aio' in
the body to majordomo@kvack.org.  For more info on Linux AIO,
see: http://www.kvack.org/aio/
Don't email: <a href=mailto:"aart@kvack.org">aart@kvack.org</a>
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic