From: Jens Axboe <[email protected]>
To: Hao Xu <[email protected]>
Cc: [email protected], Pavel Begunkov <[email protected]>,
Joseph Qi <[email protected]>
Subject: Re: [PATCH] io_uring: check file_slot early when accept use fix_file mode
Date: Tue, 7 Sep 2021 09:44:02 -0600 [thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
On 9/7/21 9:42 AM, Hao Xu wrote:
> 在 2021/9/7 下午11:37, Jens Axboe 写道:
>> On 9/7/21 9:32 AM, Hao Xu wrote:
>>> 在 2021/9/7 下午11:24, Jens Axboe 写道:
>>>> On 9/7/21 9:16 AM, Hao Xu wrote:
>>>>> check file_slot early in io_accept_prep() to avoid wasted effort in
>>>>> failure cases.
>>>>
>>>> It's generally better to just let the failure cases deal with it instead
>>>> of having checks in multiple places. This is a failure path, so we don't
>>>> care about making it fail early. Optimizations should be for the hot path,
>>>> which is not a malformed sqe.
>>> I have a question here: if we do do_accept() and but fail in
>>> io_install_fixed_file(), do we lose the conn_fd return by do_accept()
>>> forever?
>>
>> We do. The file is put and everything, so we're not leaking anything.
>> But the actual connection is lost as the accept request failed.
> Does that cause any problem, since from client's perspective, connection
> is builded, and there is no way for the server to close it.
Maybe? But it's a program error, it's asking to accept a connection at a
slot which is invalid. It kind of gets to keep the pieces in that
particular case.
--
Jens Axboe
prev parent reply other threads:[~2021-09-07 15:44 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-07 15:16 [PATCH] io_uring: check file_slot early when accept use fix_file mode Hao Xu
2021-09-07 15:24 ` Jens Axboe
2021-09-07 15:32 ` Hao Xu
2021-09-07 15:37 ` Jens Axboe
2021-09-07 15:42 ` Hao Xu
2021-09-07 15:44 ` Jens Axboe [this message]
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] \
[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