提交 083d6337 编写于 作者: J Jens Axboe 提交者: Joseph Qi

io_uring: allow AT_FDCWD for non-file openat/openat2/statx

to #26323588

commit 0b5faf6ba7fb78bb1fe7336d23ea1978386a6c3a upstream.

Don't just check for dirfd == -1, we should allow AT_FDCWD as well for
relative lookups.
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>
上级 ddf405a0
......@@ -4540,7 +4540,7 @@ static int io_req_needs_file(struct io_kiocb *req, int fd)
{
if (!io_op_defs[req->opcode].needs_file)
return 0;
if (fd == -1 && io_op_defs[req->opcode].fd_non_neg)
if ((fd == -1 || fd == AT_FDCWD) && io_op_defs[req->opcode].fd_non_neg)
return 0;
return 1;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册