Re: IORING_REGISTER_CREDS[_UPDATE]() and credfd_create()?

Pavel Begunkov
2020-01-29T10:17:55Z

[-- Attachment #1.1: Type: text/plain, Size: 1416 bytes --]

On 29/01/2020 03:54, Jens Axboe wrote:
> On 1/28/20 5:24 PM, Jens Axboe wrote:
>> On 1/28/20 5:21 PM, Pavel Begunkov wrote:
>>> On 29/01/2020 03:20, Jens Axboe wrote:
>>>> On 1/28/20 5:10 PM, Pavel Begunkov wrote:
>>>>>>>> Checked out ("don't use static creds/mm assignments")
>>>>>>>>
>>>>>>>> 1. do we miscount cred refs? We grab one in get_current_cred() for each async
>>>>>>>> request, but if (worker->creds != work->creds) it will never be put.
>>>>>>>
>>>>>>> Yeah I think you're right, that needs a bit of fixing up.
>>>>>>
>>>>>
>>>>> Hmm, it seems it leaks it unconditionally, as it grabs in a ref in
>>>>> override_creds().
>>>>>
>>>>
>>>> We grab one there, and an extra one. Then we drop one of them inline,
>>>> and the other in __io_req_aux_free().
>>>>
>>> Yeah, with the last patch it should make it even
>>
>> OK good we agree on that. I should probably pull back that bit to the
>> original patch to avoid having a hole in there...
>
> Done
>

("io_uring/io-wq: don't use static creds/mm assignments") and ("io_uring:
support using a registered personality for commands") looks good now.

Reviewed-by: Pavel Begunkov <asml.silence@gmail.com>

BTW, why do use decided to use idr, but not linear buffer scheme as for the rest
registered ones? We can rework it later for performance with linear search in
the buffer upon registration.

--
Pavel Begunkov

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]