io_uring: fix overlapped memcpy in io_req_map_rw()
authorPavel Begunkov <asml.silence@gmail.com>
Sat, 5 Sep 2020 21:45:47 +0000 (00:45 +0300)
committerJens Axboe <axboe@kernel.dk>
Wed, 9 Sep 2020 14:13:31 +0000 (08:13 -0600)
commit91d043dd1b5480acb1b3e49035a1dbf360f55cef
treec2733d1069fa56b1f16e808bfc0b4968ca3e5573
parentc714f83176469811cf3799e2f27d11ef7eb56a2e
io_uring: fix overlapped memcpy in io_req_map_rw()

When io_req_map_rw() is called from io_rw_prep_async(), it memcpy()
iorw->iter into itself. Even though it doesn't lead to an error, such a
memcpy()'s aliasing rules violation is considered to be a bad practise.

Inline io_req_map_rw() into io_rw_prep_async(). We don't really need any
remapping there, so it's much simpler than the generic implementation.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c