On 6/11/22 13:22, Hao Xu wrote:
From: Hao Xu <howeyxu@xxxxxxxxxxx> Don't update ret until fixed file is closed, otherwise the file slot becomes the error code.
I rebased and queued this and 6/6, will send them out together later, thanks https://github.com/isilence/linux/tree/io_uring/io_uring-5.19
Fixes: a7c41b4687f5 ("io_uring: let IORING_OP_FILES_UPDATE support choosing fixed file slots") Signed-off-by: Hao Xu <howeyxu@xxxxxxxxxxx> --- io_uring/rsrc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/io_uring/rsrc.c b/io_uring/rsrc.c index d78e7f2ea91f..cf8c85d1fb59 100644 --- a/io_uring/rsrc.c +++ b/io_uring/rsrc.c @@ -705,8 +705,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; } }
-- Pavel Begunkov