Re: [GIT PULL] kmalloc_obj treewide refactor for v7.0-rc1

From: Linus Torvalds

Date: Sat Feb 21 2026 - 18:19:33 EST


On Sat, 21 Feb 2026 at 15:01, Linus Torvalds
<torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
>
> But I think I found the real bug:
>
> #define overflows_flex_counter_type(TYPE, FAM, COUNT) \
> (!overflows_type(COUNT, typeof_flex_counter(((TYPE *)NULL)->FAM)))
>
> WTF is up with that '!' there? That seems entirely bogus. So now
> overflows_flex_counter_type() will return true in it *doesn't*
> overflow the type.

I pushed out what I think is the fix, but will have to run to do some
errands now so can't check it fully.

I'm pretty certain it is better than the status quo before it, though.

I did verify that at least clang doesn't generate crazy code any more
(which was never because of any clang bug, but due to the source code
being crazy).

Linus