aio: sanitize ki_list handling
authorChristoph Hellwig <hch@lst.de>
Mon, 9 Apr 2018 12:57:56 +0000 (14:57 +0200)
committerChristoph Hellwig <hch@lst.de>
Wed, 2 May 2018 17:52:59 +0000 (19:52 +0200)
commit75321b50a37a5ba612125a04bfc9e43e3da5b305
treec7a3e25787f7350fc3b48350de5b3622ac265329
parentc213dc826c591cec9e1a458f17ae474af6c8e00c
aio: sanitize ki_list handling

Instead of handcoded non-null checks always initialize ki_list to an
empty list and use list_empty / list_empty_careful on it.  While we're
at it also error out on a double call to kiocb_set_cancel_fn instead
of ignoring it.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Jeff Moyer <jmoyer@redhat.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
fs/aio.c