io_uring: refactor poll arm error handling
authorPavel Begunkov <asml.silence@gmail.com>
Thu, 23 Jun 2022 13:24:48 +0000 (14:24 +0100)
committerJens Axboe <axboe@kernel.dk>
Thu, 21 Jul 2022 14:46:49 +0000 (08:46 -0600)
commit4a615dbc8db60b8350c22550ef706066c7708a3f
tree9c7dd88ff44451ef06dde19d448eb1439c090001
parentb98248fbb312c6ebc540f1bbf7c809afa07503ed
io_uring: refactor poll arm error handling

__io_arm_poll_handler() errors parsing is a horror, in case it failed it
returns 0 and the caller is expected to look at ipt.error, which already
led us to a number of problems before.

When it returns a valid mask, leave it as it's not, i.e. return 1 and
store the mask in ipt.result_mask. In case of a failure that can be
handled inline return an error code (negative value), and return 0 if
__io_arm_poll_handler() took ownership of the request and will complete
it.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/018cacdaef5fe95d7dc56b32e85d752cab7607f6.1655990418.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/poll.c