Re: [for-linus][PATCH 1/9] tracing/remotes: Fix page_va[] access before counter update in trace_remote_alloc_buffer()

From: Steven Rostedt

Date: Sat Jul 25 2026 - 07:03:51 EST


On Sat, 25 Jul 2026 11:00:12 +0100
David Laight <david.laight.linux@xxxxxxxxx> wrote:

> Uggg...
> Shouldn't the __counted_by() field be the size of the array itself, not the
> number of valid items?

Not always. It's simply a way to tell the compiler which field holds the
number of elements for a dynamic array. Sometimes that field is used to
create the array itself, but like in this case, that field is used to
compare with another value that holds the size that happens not to be part
of the structure.

-- Steve