Re: [PATCH 07/33] aio: add kiocb_cancel()

From: Jeff Moyer
Date: Fri Apr 12 2013 - 11:58:51 EST


Kent Overstreet <koverstreet@xxxxxxxxxx> writes:

> Minor refactoring, to get rid of some duplicated code
>
> [akpm@xxxxxxxxxxxxxxxxxxxx: fix warning]
> Signed-off-by: Kent Overstreet <koverstreet@xxxxxxxxxx>
> Cc: Zach Brown <zab@xxxxxxxxxx>
> Cc: Felipe Balbi <balbi@xxxxxx>
> Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
> Cc: Mark Fasheh <mfasheh@xxxxxxxx>
> Cc: Joel Becker <jlbec@xxxxxxxxxxxx>
> Cc: Rusty Russell <rusty@xxxxxxxxxxxxxxx>
> Cc: Jens Axboe <axboe@xxxxxxxxx>
> Cc: Asai Thambi S P <asamymuthupa@xxxxxxxxxx>
> Cc: Selvan Mani <smani@xxxxxxxxxx>
> Cc: Sam Bradshaw <sbradshaw@xxxxxxxxxx>
> Cc: Jeff Moyer <jmoyer@xxxxxxxxxx>
> Cc: Al Viro <viro@xxxxxxxxxxxxxxxxxx>
> Cc: Benjamin LaHaise <bcrl@xxxxxxxxx>
> Cc: Theodore Ts'o <tytso@xxxxxxx>
> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>

The patch looks to preserve existing behaviour. However, the man page
and the code disagree about the return code in the event that there is
no cancelation routine (well, in the event that the iocb could not be
canceled):

ERRORS
EAGAIN The iocb specified was not canceled.

EFAULT One of the data structures points to invalid data.

EINVAL The AIO context specified by ctx_id is invalid.

ENOSYS io_cancel() is not implemented on this architecture.

The code (before and after the patch) returns EINVAL when the iocb was
not canceled. Should we fix the code or the docs, here?

For the patch:

Acked-by: Jeff Moyer <jmoyer@xxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/