Re: [PATCH v2] io-wq: handle hashed writes in chains

Pavel Begunkov
2020-03-22T17:38:48Z

On 22/03/2020 20:08, Jens Axboe wrote:
>>> + */
>>> + if (!work) {
>>> + work = wq_first_entry(&list,
>>> + struct io_wq_work,
>>> + list);
>>
>> Wouldn't it just drop a linked request? Probably works because of the
>> comment above.
>
> Only drops if if we always override 'work', if it's already set we use
> 'work' and don't grab from the list. So that should work for links.
>

Oh, right, the NULL check is just above.

>>> + if (work) {
>>> + wq_node_del(&list, &work->list);
>>
>> There is a bug, apparently from one of my commits, where it do
>> io_assign_current_work() but then re-enqueue and reassign new work,
>> though there is a gap for cancel to happen, which would screw
>> everything up.
>>
>> I'll send a patch, so it'd be more clear. However, this is a good
>> point to look after for this as well.
>
> Saw it, I'll apply when you have the Fixes line. I'll respin this one
> after.
>

--
Pavel Begunkov