Thread (30 messages) 30 messages, 6 authors, 2017-09-26

Re: [PATCH 04/12] bcache: Don't reinvent the wheel but use existing llist API

From: Michael Lyle <hidden>
Date: 2017-09-26 19:55:54
Also in: linux-bcache

Thanks everyone--

Yes, this looks good to me and works in testing.

Mike

On Tue, Sep 26, 2017 at 12:46 AM, Coly Li [off-list ref] wrote:
On 2017/9/26 =E4=B8=8B=E5=8D=8812:38, Michael Lyle wrote:
quoted
I believe this introduces a critical bug.

cl->list is used to link together the llists for both things waiting,
and for things that are being woken.

If a closure that is woken decides to wait again, it will corrupt the
llist that __closure_wake_up is using.

The previous iteration structure gets the next element of the list
before waking and is therefore safe.

Hi Michael and Byungchul,

This is my fault to suggest Byungchul to change his correct patch into
wrong one. But it's good to learn such an implicit race behind bcache
code. I just post a patch to explain how this race may happen and
corrupt the reverse list iteration. Could you please to review the fix ?

And thanks to Michael again to catch this bug.

--
Coly Li
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help