提交 861c7c78 编写于 作者: J Jens Axboe 提交者: Joseph Qi

io_uring: warn about unhandled opcode

to #26323578

commit e781573e2fb1b75acdba61dcb9bcbfc16f288442 upstream.

Now that we have all the opcodes handled in terms of command prep and
SQE reuse, add a printk_once() to warn about any potentially new and
unhandled ones.
Signed-off-by: NJens Axboe <axboe@kernel.dk>
Signed-off-by: NJoseph Qi <joseph.qi@linux.alibaba.com>
Acked-by: NXiaoguang Wang <xiaoguang.wang@linux.alibaba.com>
上级 96baaf97
......@@ -3075,9 +3075,11 @@ static int io_req_defer_prep(struct io_kiocb *req)
struct iovec inline_vecs[UIO_FASTIOV], *iovec = inline_vecs;
struct io_async_ctx *io = req->io;
struct iov_iter iter;
ssize_t ret;
ssize_t ret = 0;
switch (req->opcode) {
case IORING_OP_NOP:
break;
case IORING_OP_READV:
case IORING_OP_READ_FIXED:
/* ensure prep does right import */
......@@ -3137,7 +3139,9 @@ static int io_req_defer_prep(struct io_kiocb *req)
ret = io_accept_prep(req);
break;
default:
ret = 0;
printk_once(KERN_WARNING "io_uring: unhandled opcode %d\n",
req->opcode);
ret = -EINVAL;
break;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册