All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Begunkov <asml.silence@gmail.com>
To: Jens Axboe <axboe@kernel.dk>, io-uring@vger.kernel.org
Subject: Re: [PATCH] io_uring: make OP_CLOSE consistent direct open
Date: Fri, 24 Sep 2021 21:11:13 +0100	[thread overview]
Message-ID: <0dc9a628-19f9-1861-e948-056f1f48c7ed@gmail.com> (raw)
In-Reply-To: <923961d5-28f6-c3d0-680b-035560c9e52a@kernel.dk>

On 9/24/21 9:06 PM, Jens Axboe wrote:
> On 9/24/21 1:57 PM, Jens Axboe wrote:
>> On 9/24/21 1:04 PM, Pavel Begunkov wrote:
>>> From recently open/accept are now able to manipulate fixed file table,
>>> but it's inconsistent that close can't. Close the gap, keep API same as
>>> with open/accept, i.e. via sqe->file_slot.
>>
>> I really think we should do this for 5.15 to make the API a bit more
>> sane from the user point of view, folks definitely expect being able
>> to use IORING_OP_CLOSE with a fixed file that they got with IORING_OP_OPEN,
>> for example.
>>
>> How about this small tweak, basically making it follow the same rules
>> as other commands that do fixed files:
>>
>> 1) Require IOSQE_FIXED_FILE to be set for a direct close. sqe->file_index
>>    will be the descriptor to close in that case. If sqe->fd is set, we
>>    -EINVAL the request.
>>
>> 2) If IOSQE_FIXED_FILE isn't set, it's a normal close. As before, if
>>    sqe->file_index is set and IOSQE_FIXED_FILE isn't, then we -EINVAL
>>    the request.
>>
>> Basically this incremental on top of yours.
> 
> Hmm, we don't require that for open or accept. Why not? Seems a bit
> counter intuitive. But maybe it's better we do this one as-is, and then

Accept takes a fd as an argument and so IOSQE_FIXED_FILE already applies
to it and can't be used as described. Close is just made consistent with
the rest.


> do a followup patch that solidifies the fact that IOSQE_FIXED_FILE
> should be set for direct open/accept/close.
> 

-- 
Pavel Begunkov

  reply	other threads:[~2021-09-24 20:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-24 19:04 [PATCH] io_uring: make OP_CLOSE consistent direct open Pavel Begunkov
2021-09-24 19:57 ` Jens Axboe
2021-09-24 20:06   ` Jens Axboe
2021-09-24 20:11     ` Pavel Begunkov [this message]
2021-09-24 20:19       ` Jens Axboe
2021-09-24 20:21         ` Pavel Begunkov
2021-09-24 20:25           ` Jens Axboe
2021-09-24 19:58 ` Jens Axboe
2021-09-24 19:59   ` Jens Axboe

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 \
    --in-reply-to=0dc9a628-19f9-1861-e948-056f1f48c7ed@gmail.com \
    --to=asml.silence@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=io-uring@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.