io_uring: fix pre-prepped issue with force_nonblock == true
authorJens Axboe <axboe@kernel.dk>
Mon, 16 Dec 2019 05:13:43 +0000 (22:13 -0700)
committerJens Axboe <axboe@kernel.dk>
Wed, 18 Dec 2019 02:57:20 +0000 (19:57 -0700)
commitb7bb4f7da0a1a92f142697f1c9ce335e7a44f4b1
treeecb67299672c337c0c0bef786cffb5f3fc3d5d25
parent525b305d61ede489ce2118b000a5dabd6d869dac
io_uring: fix pre-prepped issue with force_nonblock == true

Some of these code paths assume that any force_nonblock == true issue
is not prepped, but that's not true if we did prep as part of link setup
earlier. Check if we already have an async context allocate before
setting up a new one.

Cleanup the async context setup in general, we have a lot of duplicated
code there.

Fixes: 03b1230ca12a ("io_uring: ensure async punted sendmsg/recvmsg requests copy data")
Fixes: f67676d160c6 ("io_uring: ensure async punted read/write requests copy iovec")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c