]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: ensure registered buffer import returns the IO length
authorJens Axboe <axboe@kernel.dk>
Wed, 13 Nov 2019 23:12:46 +0000 (16:12 -0700)
committerJens Axboe <axboe@kernel.dk>
Wed, 13 Nov 2019 23:15:14 +0000 (16:15 -0700)
commite94914e7dcee0830541ec9b2cceb0ba2c424476a
treee517c845a7d4e0014be9cd13e7c1404dafec361e
parent7909c1c6a0c4b08ab93ed1bf485c2b2ecceafe8f
io_uring: ensure registered buffer import returns the IO length

A test case was reported where two linked reads with registered buffers
failed the second link always. This is because we set the expected value
of a request in req->result, and if we don't get this result, then we
fail the dependent links. For some reason the registered buffer import
returned -ERROR/0, while the normal import returns -ERROR/length. This
broke linked commands with registered buffers.

Fix this by making io_import_fixed() correctly return the mapped length.

Cc: stable@vger.kernel.org # v5.3
Reported-by: 李通洲 <carter.li@eoitek.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c