提交 e71d7c56 编写于 作者: H Hao Xu 提交者: Pavel Begunkov

io_uring: openclose: fix bug of closing wrong fixed file

Don't update ret until fixed file is closed, otherwise the file slot
becomes the error code.

Fixes: a7c41b46 ("io_uring: let IORING_OP_FILES_UPDATE support choosing fixed file slots")
Signed-off-by: NHao Xu <howeyxu@tencent.com>
[pavel: 5.19 rebase]
Signed-off-by: NPavel Begunkov <asml.silence@gmail.com>
上级 05b538c1
......@@ -8035,8 +8035,8 @@ static int io_files_update_with_index_alloc(struct io_kiocb *req,
if (ret < 0)
break;
if (copy_to_user(&fds[done], &ret, sizeof(ret))) {
ret = -EFAULT;
__io_close_fixed(req, issue_flags, ret);
ret = -EFAULT;
break;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册