OSDN Git Service

io_uring: correctly handle non ->{read,write}_iter() file_operations
authorJens Axboe <axboe@kernel.dk>
Mon, 23 Sep 2019 17:05:34 +0000 (11:05 -0600)
committerJens Axboe <axboe@kernel.dk>
Mon, 23 Sep 2019 17:05:34 +0000 (11:05 -0600)
commit32960613b7c3352ddf38c42596e28a16ae36335e
tree60748bfdf64056a50293f2b4c0641c3e728e6813
parent5262f567987d3c30052b22e78c35c2313d07b230
io_uring: correctly handle non ->{read,write}_iter() file_operations

Currently we just -EINVAL a read or write to an fd that isn't backed
by ->read_iter() or ->write_iter(). But we can handle them just fine,
as long as we punt fo async context first.

Implement a simple loop function for doing ->read() or ->write()
instead, and ensure we call it appropriately.

Reported-by: 李通洲 <carter.li@eoitek.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c