Re: [PATCH v2] lib/assoc_array: fix stale nr_leaves_on_tree after gc
From: Josh Law
Date: Thu Mar 19 2026 - 13:33:21 EST
On 19 March 2026 17:04:32 GMT, David Howells <dhowells@xxxxxxxxxx> wrote:
>Josh Law <objecting@xxxxxxxxxxxxx> wrote:
>
>> Well, the bug actually is there,
>
>But is there a bug? The field is internal to assoc_array, and the assoc_array
>code only accesses it if the caller is holding a lock to prevent other
>modifications. The field is not pertinent to searching the tree under just
>the RCU read lock.
>
>> and if i made a mistake, this patch should atleast be hardening level, (As i
>> say, better safe than sorry)
>
>Your patch doesn't actually fix the issue; it merely slides the window. The
>window *could* be closed on x86_64, say, by using CMPXCHG16 to change both the
>root pointer and the counter simultaneously, but beyond that you can't close
>it without using a lock.
>
>David
>
After double checking, it appears you are right, sorry for wasting your time
V/R
Josh Law