From: Pavel Begunkov <[email protected]>
To: Hao Xu <[email protected]>, [email protected]
Cc: Jens Axboe <[email protected]>
Subject: Re: [PATCH 5.19 2/6] io_uring: openclose: fix bug of closing wrong fixed file
Date: Sat, 11 Jun 2022 14:13:32 +0100 [thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
On 6/11/22 13:22, Hao Xu wrote:
> From: Hao Xu <[email protected]>
>
> Don't update ret until fixed file is closed, otherwise the file slot
> becomes the error code.
>
> Fixes: a7c41b4687f5 ("io_uring: let IORING_OP_FILES_UPDATE support choosing fixed file slots")
> Signed-off-by: Hao Xu <[email protected]>
> ---
> io_uring/rsrc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/io_uring/rsrc.c b/io_uring/rsrc.c
Something strange is going on here, io_uring/rsrc.c was only queued for
5.20, but it's marked 5.19, weird.
> 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
next prev parent reply other threads:[~2022-06-11 13:14 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-11 12:22 [PATCH for-5.20 1/6] io_uring: poll: remove unnecessary req->ref set Hao Xu
2022-06-11 12:22 ` [PATCH 5.19 2/6] io_uring: openclose: fix bug of closing wrong fixed file Hao Xu
2022-06-11 13:13 ` Pavel Begunkov [this message]
2022-06-12 17:47 ` Pavel Begunkov
2022-06-13 3:45 ` Hao Xu
2022-06-11 12:22 ` [PATCH 5.19 3/6] io_uring: openclose: fix bug of unexpected return value in IORING_CLOSE_FD_AND_FILE_SLOT mode Hao Xu
2022-06-11 12:22 ` [PATCH for-5.20 4/6] io_uring: openclose: support separate return value for IORING_CLOSE_FD_AND_FILE_SLOT Hao Xu
2022-06-11 12:22 ` [PATCH for-5.20 5/6] io_uring: remove duplicate kbuf release Hao Xu
2022-06-11 12:29 ` [PATCH 5.19 6/6] io_uring: kbuf: fix bug of not consuming ring buffer in partial io case Hao Xu
2022-06-12 17:44 ` [PATCH for-5.20 1/6] io_uring: poll: remove unnecessary req->ref set Pavel Begunkov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox